summaryrefslogtreecommitdiffstats
path: root/XUtils.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-11-24 18:14:56 +0100
committerBenny Baumann <BenBE@geshi.org>2020-12-06 16:03:44 +0100
commitd9224c66a41e7918570b81d41495870c20380c1d (patch)
tree44a1fe7c1fede2d4053506b97c2257be3b702a77 /XUtils.c
parent3d15ba51974827693ed7d34149290c812d652dd9 (diff)
Use size_t as len type for xSnprintf
Like the C snprintf function
Diffstat (limited to 'XUtils.c')
-rw-r--r--XUtils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/XUtils.c b/XUtils.c
index 743d98bf..cd5edb91 100644
--- a/XUtils.c
+++ b/XUtils.c
@@ -184,13 +184,13 @@ int xAsprintf(char** strp, const char* fmt, ...) {
return r;
}
-int xSnprintf(char* buf, int len, const char* fmt, ...) {
+int xSnprintf(char* buf, size_t len, const char* fmt, ...) {
va_list vl;
va_start(vl, fmt);
int n = vsnprintf(buf, len, fmt, vl);
va_end(vl);
- if (n < 0 || n >= len) {
+ if (n < 0 || (size_t)n >= len) {
fail();
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy