]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
pathchk: avoid -Wsign-compare warnings
authorPádraig Brady <P@draigBrady.com>
Thu, 15 Jan 2009 17:36:27 +0000 (17:36 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 16 Jan 2009 11:06:09 +0000 (11:06 +0000)
* src/pathchk.c: Compare pathconf limits to _signed_ MAX constants,
as pathconf returns signed values.

src/pathchk.c

index 5dbc7da683868ed1b66d408f69c5c97524c7bf7c..526134507baea9844768131a3f38f6d171361ff0 100644 (file)
@@ -1,5 +1,5 @@
 /* pathchk -- check whether file names are valid or portable
-   Copyright (C) 1991-2008 Free Software Foundation, Inc.
+   Copyright (C) 1991-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -323,7 +323,7 @@ validate_file_name (char *file, bool check_basic_portability,
                     dir);
              return false;
            }
-         maxsize = MIN (size, SIZE_MAX);
+         maxsize = MIN (size, SSIZE_MAX);
        }
 
       if (maxsize <= filelen)
@@ -385,7 +385,7 @@ validate_file_name (char *file, bool check_basic_portability,
              len = pathconf (dir, _PC_NAME_MAX);
              *start = c;
              if (0 <= len)
-               name_max = MIN (len, SIZE_MAX);
+               name_max = MIN (len, SSIZE_MAX);
              else
                switch (errno)
                  {