summaryrefslogtreecommitdiff
path: root/AuRead.c
diff options
context:
space:
mode:
Diffstat (limited to 'AuRead.c')
-rw-r--r--AuRead.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/AuRead.c b/AuRead.c
index f7cdf8f..9979c1d 100644
--- a/AuRead.c
+++ b/AuRead.c
@@ -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;