summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-08-27 19:53:02 +0000
committerMatt Wilson <msw@redhat.com>2001-08-27 19:53:02 +0000
commit42ca8a6aa4219b4688025fafe9132b0f68ba58fd (patch)
tree941743287faae440def3cb9efa3e7b7e74212faa /loader
parent41a7624d61cbb8810506d81532200bf81f5d90d6 (diff)
downloadanaconda-42ca8a6aa4219b4688025fafe9132b0f68ba58fd.tar.gz
anaconda-42ca8a6aa4219b4688025fafe9132b0f68ba58fd.tar.xz
anaconda-42ca8a6aa4219b4688025fafe9132b0f68ba58fd.zip
fix for building with glibc where strnlen(foo, -1) == -1 and not 3
Diffstat (limited to 'loader')
-rw-r--r--loader/printf-stub.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/loader/printf-stub.c b/loader/printf-stub.c
index b0fb6a9af..39d4704d7 100644
--- a/loader/printf-stub.c
+++ b/loader/printf-stub.c
@@ -223,7 +223,10 @@ static void xprintf(const char *fmt, va_list args)
if (!s)
s = "(null)";
got_string:
- len = strnlen(s, precision);
+ if (precision >= 0)
+ len = strnlen(s, precision);
+ else
+ len = strlen(s);
check(field_width > len ? field_width : len);
if (!(flags & LEFT))