From 308430e751fb6315936d2c426a9601e471831eec Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 12 Sep 2004 05:00:48 +0000 Subject: [PATCH] Fix the previous rev. --- src/lib/subs/nstr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/subs/nstr.c b/src/lib/subs/nstr.c index 2e80912d..49d4ce8a 100644 --- a/src/lib/subs/nstr.c +++ b/src/lib/subs/nstr.c @@ -136,9 +136,10 @@ nstr_comp(struct nscstr *np, int len, int type, char *str) static int strnncmp(char *s1, size_t sz1, char *s2, size_t sz2) { + int res; if (sz1 == sz2) return strncmp(s1, s2, sz2); if (sz1 < sz2) return -strnncmp(s2, sz2, s1, sz1); - int res = strncmp(s1, s2, sz2); + res = strncmp(s1, s2, sz2); return res ? res : s1[sz2]; }