Commit bf57cc47 authored by Jeff Hammond's avatar Jeff Hammond Committed by Pavan Balaji
Browse files

return result of strlen to proper type



strlen returns size_t.  since the return argument is localized, there is
no reason to not use the proper type to hold the result.
Signed-off-by: Rob Latham's avatarRob Latham <robl@mcs.anl.gov>
parent 91e91a40
......@@ -70,7 +70,7 @@ int MPL_snprintf(char *str, size_t size, mpl_const char *format, ...)
val = va_arg(list, int);
sprintf(tmp, "%d", val);
if (width > 0) {
int tmplen = strlen(tmp);
size_t tmplen = strlen(tmp);
/* If a width was specified, pad with spaces on the
* left (on the right if %-3d given; not implemented yet */
while (size-- > 0 && width-- > tmplen)
......@@ -91,7 +91,7 @@ int MPL_snprintf(char *str, size_t size, mpl_const char *format, ...)
val = va_arg(list, int);
sprintf(tmp, "%x", val);
if (width > 0) {
int tmplen = strlen(tmp);
size_t tmplen = strlen(tmp);
/* If a width was specified, pad with spaces on the
* left (on the right if %-3d given; not implemented yet */
while (size-- > 0 && width-- > tmplen)
......@@ -112,7 +112,7 @@ int MPL_snprintf(char *str, size_t size, mpl_const char *format, ...)
val = va_arg(list, void *);
sprintf(tmp, "%p", val);
if (width > 0) {
int tmplen = strlen(tmp);
size_t tmplen = strlen(tmp);
/* If a width was specified, pad with spaces on the
* left (on the right if %-3d given; not implemented yet */
while (size-- > 0 && width-- > tmplen)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment