From f3b788703e4cc728a415008b0ddd70d1016a09cc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 19 Feb 2017 19:34:13 +0100 Subject: [PATCH] tag/Handler: improve snprintf() return value check --- src/tag/TagHandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tag/TagHandler.cxx b/src/tag/TagHandler.cxx index 46e3e79b4..345c64a21 100644 --- a/src/tag/TagHandler.cxx +++ b/src/tag/TagHandler.cxx @@ -44,7 +44,7 @@ add_tag_tag(TagType type, const char *value, void *ctx) unsigned n = strtoul(value, &end, 10); if (value != end) { char s[21]; - if (snprintf(s, 21, "%u", n) >= 0) + if (snprintf(s, 21, "%u", n) > 0) tag.AddItem(type, s); } } else