bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls segfault


From: Jim Meyering
Subject: Re: ls segfault
Date: Fri, 23 Apr 2004 19:25:22 +0200

Mikulas Patocka <address@hidden> wrote:
> This patch fixes segmentation fault with ls on systems, where SIZE_MAX is
> different from -1.

Thank you!
I suppose you noticed the actual segfault.
What type of system were you using?

BTW, there is one other such use in the current (CVS) sources:

--- src/ls.c    21 Apr 2004 12:51:27 -0000      1.353
+++ src/ls.c    23 Apr 2004 17:20:08 -0000
@@ -3231,7 +3231,8 @@ quote_name (FILE *out, const char *name,
            size_t *width)
 {
   char smallbuf[BUFSIZ];
-  size_t len = quotearg_buffer (smallbuf, sizeof smallbuf, name, -1, options);
+  size_t len = quotearg_buffer (smallbuf, sizeof smallbuf, name, SIZE_MAX,
+                               options);
   char *buf;
   size_t displayed_width IF_LINT (= 0);
 
@@ -3240,7 +3241,7 @@ quote_name (FILE *out, const char *name,
   else
     {
       buf = alloca (len + 1);
-      quotearg_buffer (buf, len + 1, name, -1, options);
+      quotearg_buffer (buf, len + 1, name, SIZE_MAX, options);
     }
 
   if (qmark_funny_chars)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]