]> arthur.barton.de Git - netatalk.git/commitdiff
small fixes from Björn Fernhomberg, remove compiler warnings and a malloc
authordidg <didg>
Mon, 2 Jun 2003 06:54:22 +0000 (06:54 +0000)
committerdidg <didg>
Mon, 2 Jun 2003 06:54:22 +0000 (06:54 +0000)
check.

etc/afpd/file.c
etc/afpd/mangle.h
etc/afpd/messages.c

index 5b330a838690e1b0151a1bdf3712cae3738aa37b..2c340836b6a8f0778a8b1b92931c96822b823ce1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.92 2003-04-26 16:53:44 didg Exp $
+ * $Id: file.c,v 1.93 2003-06-02 06:54:22 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -58,6 +58,7 @@ char *strchr (), *strrchr ();
 #include "file.h"
 #include "filedir.h"
 #include "globals.h"
+#include "unix.h"
 
 /* the format for the finderinfo fields (from IM: Toolbox Essentials):
  * field         bytes        subfield    bytes
index ac01a7a6f7dfd38788225ddc528c089b2c97f661..85ce372a3073834fa10fff781ddcbb04bb4f3ff7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: mangle.h,v 1.4 2003-03-09 19:55:35 didg Exp $
+ * $Id: mangle.h,v 1.5 2003-06-02 06:54:23 didg Exp $
  *
  */
 
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <stdio.h>
 
 #include <atalk/adouble.h>
 #ifdef CNID_DB
index c723211ae1936901dca5fca57586ac81d6205b18..0918e421c573a386f17aac768b93a00289d04a96 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: messages.c,v 1.16 2002-03-24 01:23:41 sibaz Exp $
+ * $Id: messages.c,v 1.17 2003-06-02 06:54:23 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -10,6 +10,7 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include <atalk/afp.h>
@@ -42,7 +43,11 @@ void readmessage(void)
 
     i=0;
     /* Construct file name SERVERTEXT/message.[pid] */
-    filename=malloc(sizeof(SERVERTEXT)+15);
+    if ( NULL == (filename=(char*) malloc(sizeof(SERVERTEXT)+15)) ) {
+       LOG(log_error, logtype_afpd, "readmessage: malloc: %s", strerror(errno) );
+        return;
+    }
+
     sprintf(filename, "%s/message.%d", SERVERTEXT, getpid());
 
 #ifdef DEBUG