MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / crm_version_helper

Function crm_version_helper

lib/common/utils.c:376–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374
375
376static int
377crm_version_helper(const char *text, char **end_text)
378{
379 int atoi_result = -1;
380
381 CRM_ASSERT(end_text != NULL);
382
383 errno = 0;
384
385 if (text != NULL && text[0] != 0) {
386 atoi_result = (int)strtol(text, end_text, 10);
387
388 if (errno == EINVAL) {
389 crm_err("Conversion of '%s' %c failed", text, text[0]);
390 atoi_result = -1;
391 }
392 }
393 return atoi_result;
394}
395
396/*
397 * version1 < version2 : -1

Callers 1

compare_versionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected