aboutsummaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2018-11-20 11:59:28 +0000
committerEric Engestrom <[email protected]>2019-07-19 22:39:38 +0100
commitdffeaa55dd1155d7a1e8feb5ecfc54fff688fcd8 (patch)
treea232b3bef0f7251f90cd3a279674218c46a60d65 /src/util
parent00e23cd96998deae429508efa10545be13420379 (diff)
util: use standard name for snprintf()
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/u_debug.c6
-rw-r--r--src/util/u_queue.c8
-rw-r--r--src/util/u_string.h2
3 files changed, 8 insertions, 8 deletions
diff --git a/src/util/u_debug.c b/src/util/u_debug.c
index adf62ae9b4a..9e547f508ca 100644
--- a/src/util/u_debug.c
+++ b/src/util/u_debug.c
@@ -330,7 +330,7 @@ debug_dump_enum(const struct debug_named_value *names,
++names;
}
- util_snprintf(rest, sizeof(rest), "0x%08lx", value);
+ snprintf(rest, sizeof(rest), "0x%08lx", value);
return rest;
}
@@ -354,7 +354,7 @@ debug_dump_enum_noprefix(const struct debug_named_value *names,
++names;
}
- util_snprintf(rest, sizeof(rest), "0x%08lx", value);
+ snprintf(rest, sizeof(rest), "0x%08lx", value);
return rest;
}
@@ -387,7 +387,7 @@ debug_dump_flags(const struct debug_named_value *names, unsigned long value)
else
first = 0;
- util_snprintf(rest, sizeof(rest), "0x%08lx", value);
+ snprintf(rest, sizeof(rest), "0x%08lx", value);
strncat(output, rest, sizeof(output) - strlen(output) - 1);
output[sizeof(output) - 1] = '\0';
}
diff --git a/src/util/u_queue.c b/src/util/u_queue.c
index cd0b95b6ead..46c61eb8b7b 100644
--- a/src/util/u_queue.c
+++ b/src/util/u_queue.c
@@ -257,7 +257,7 @@ util_queue_thread_func(void *input)
if (strlen(queue->name) > 0) {
char name[16];
- util_snprintf(name, sizeof(name), "%s%i", queue->name, thread_index);
+ snprintf(name, sizeof(name), "%s%i", queue->name, thread_index);
u_thread_setname(name);
}
@@ -405,10 +405,10 @@ util_queue_init(struct util_queue *queue,
memset(queue, 0, sizeof(*queue));
if (process_len) {
- util_snprintf(queue->name, sizeof(queue->name), "%.*s:%s",
- process_len, process_name, name);
+ snprintf(queue->name, sizeof(queue->name), "%.*s:%s",
+ process_len, process_name, name);
} else {
- util_snprintf(queue->name, sizeof(queue->name), "%s", name);
+ snprintf(queue->name, sizeof(queue->name), "%s", name);
}
queue->flags = flags;
diff --git a/src/util/u_string.h b/src/util/u_string.h
index 846b64feb11..456de63d288 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -82,6 +82,7 @@ util_vsnprintf(char *str, size_t size, const char *format, va_list ap)
return ret;
}
+#define snprintf util_snprintf
static inline int
PRINTFLIKE(3, 4)
util_snprintf(char *str, size_t size, const char *format, ...)
@@ -184,7 +185,6 @@ util_strncmp(const char *s1, const char *s2, size_t n)
#else
#define util_vsnprintf vsnprintf
-#define util_snprintf snprintf
#endif