MCPcopy Index your code
hub / github.com/F-Stack/f-stack / str_scale

Function str_scale

tools/libutil/tests/humanize_number_test.c:478–489  ·  view source on GitHub ↗

Format scale parameter for meaningful display */

Source from the content-addressed store, hash-verified

476
477/* Format scale parameter for meaningful display */
478static char *
479str_scale(int scale) {
480 char *result;
481
482 if (scale == HN_AUTOSCALE || scale == HN_GETSCALE)
483 return str_flags(scale, "");
484
485 result = malloc(MAX_INT_STR_DIGITS);
486 result[0] = '\0';
487 snprintf(result, MAX_INT_STR_DIGITS, "%d", scale);
488 return result;
489}
490
491static void
492testskipped(size_t i)

Callers 1

mainFunction · 0.85

Calls 3

str_flagsFunction · 0.85
mallocFunction · 0.85
snprintfFunction · 0.85

Tested by

no test coverage detected