diff options
author | Matt Wilson <msw@redhat.com> | 2001-08-27 19:53:02 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2001-08-27 19:53:02 +0000 |
commit | 42ca8a6aa4219b4688025fafe9132b0f68ba58fd (patch) | |
tree | 941743287faae440def3cb9efa3e7b7e74212faa /loader | |
parent | 41a7624d61cbb8810506d81532200bf81f5d90d6 (diff) | |
download | anaconda-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.c | 5 |
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)) |