diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-04 22:02:52 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-12-04 22:02:52 +0000 |
commit | 45b73c360dc68b023194758bbb1cc59c021742a6 (patch) | |
tree | 5c0aefc201d4ff9a32b9aae7f55a425a4495c6e7 /src/authutil.c | |
parent | c919c3d0b355ef67dfa0b511eb1da488e5786d1b (diff) |
XFree86 4.3.99.901 (RC 1)xf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-012804-2330
Diffstat (limited to 'src/authutil.c')
-rw-r--r-- | src/authutil.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/authutil.c b/src/authutil.c index abdbf44..7fb9bd1 100644 --- a/src/authutil.c +++ b/src/authutil.c @@ -26,7 +26,7 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ -/* $XFree86: xc/lib/ICE/authutil.c,v 3.9 2002/05/31 18:45:41 dawes Exp $ */ +/* $XFree86: xc/lib/ICE/authutil.c,v 3.10 2003/11/26 21:48:18 herrb Exp $ */ #include <X11/ICE/ICElib.h> #include "ICElibint.h" @@ -418,25 +418,21 @@ char **stringp; if (!read_short (file, &len)) return (0); - if (len == 0) - { - data = 0; - } - else - { - data = malloc ((unsigned) len + 1); - - if (!data) + data = malloc ((unsigned) len + 1); + + if (!data) return (0); - - if (fread (data, (int) sizeof (char), (int) len, file) != len) + + if (len != 0) + { + if (fread (data, (int) sizeof (char), (int) len, file) != len) { free (data); return (0); - } - - data[len] = '\0'; + } + } + data[len] = '\0'; *stringp = data; |