From: Ulrich Drepper Date: Wed, 10 Nov 1999 08:13:39 +0000 (+0000) Subject: (strsignal): Correct check for snprintf return value. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52f5ad999e60eaf7fcf552ef7ee4ae90cdd2be44;p=thirdparty%2Fglibc.git (strsignal): Correct check for snprintf return value. --- diff --git a/string/strsignal.c b/string/strsignal.c index 90480f5d4a3..0c0155434ef 100644 --- a/string/strsignal.c +++ b/string/strsignal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 94, 95, 96, 97, 98 Free Software Foundation, Inc. +/* Copyright (C) 1991, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -69,7 +69,7 @@ strsignal (int signum) #endif len = __snprintf (buffer, BUFFERSIZ - 1, _("Unknown signal %d"), signum); - if (len < 0) + if (len >= BUFFERSIZ) buffer = NULL; else buffer[len] = '\0';