diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-06-28 22:26:50 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-06-28 22:26:50 +0000 |
commit | 8274b8e4b121c3dc3bfd5d0fa4f85bc23f5c09a0 (patch) | |
tree | cb61869ef8db7fba494853286faba6a7901198ac /AuRead.c | |
parent | 7f6f90cfce51806340f25b80a87b147d8a743b27 (diff) |
Remove prototype for XauGetAuthByName to clear lint warning: name declared
but never used or defined
Fix sparse warnings:
-warning: Using plain integer as NULL pointer
-warning: non-ANSI definition of function
Diffstat (limited to 'AuRead.c')
-rw-r--r-- | AuRead.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -53,7 +53,7 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file) if (read_short (&len, file) == 0) return 0; if (len == 0) { - data = 0; + data = NULL; } else { data = malloc ((unsigned) len); if (!data) @@ -70,30 +70,29 @@ read_counted_string (unsigned short *countp, char **stringp, FILE *file) } Xauth * -XauReadAuth (auth_file) -FILE *auth_file; +XauReadAuth (FILE *auth_file) { Xauth local; Xauth *ret; if (read_short (&local.family, auth_file) == 0) - return 0; + return NULL; if (read_counted_string (&local.address_length, &local.address, auth_file) == 0) - return 0; + return NULL; if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) { if (local.address) free (local.address); - return 0; + return NULL; } if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) { if (local.address) free (local.address); if (local.number) free (local.number); - return 0; + return NULL; } if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) { if (local.address) free (local.address); if (local.number) free (local.number); if (local.name) free (local.name); - return 0; + return NULL; } ret = (Xauth *) malloc (sizeof (Xauth)); if (!ret) { @@ -104,7 +103,7 @@ FILE *auth_file; bzero (local.data, local.data_length); free (local.data); } - return 0; + return NULL; } *ret = local; return ret; |