- fixed some compiler warnings
authorAndrew Tridgell <tridge@samba.org>
Sat, 28 Apr 2001 14:01:02 +0000 (14:01 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 28 Apr 2001 14:01:02 +0000 (14:01 +0000)
- fixed slprintf and vsprintf macros
(This used to be commit c986a3c51e8cdbc1230edbe0f4a91138c4ada29d)

source3/include/includes.h
source3/include/proto.h
source3/libsmb/clisecdesc.c
source3/passdb/passdb.c
source3/smbd/reply.c

index a5fa555058265ee69e1754a6aa335acfa4dd99ac..e2edb512ae5f4c6f8184a391487406e3b44fb337 100644 (file)
 #endif
 #endif
 
+/* use gcc attribute to check printf fns */
+#ifdef __GNUC__
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
+
 #ifdef RELIANTUNIX
 /*
  * <unistd.h> has to be included before any other to get
@@ -995,12 +1002,6 @@ extern int DEBUGLEVEL;
 #endif
 
 /* add varargs prototypes with printf checking */
-#ifdef __GNUC__
-#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
-#else
-#define PRINTF_ATTRIBUTE(a1, a2)
-#endif
-
 int fdprintf(int , char *, ...) PRINTF_ATTRIBUTE(2,3);
 #ifndef HAVE_SNPRINTF
 int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
@@ -1009,5 +1010,10 @@ int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
 int asprintf(char **,char *, ...) PRINTF_ATTRIBUTE(2,3);
 #endif
 
+/* we used to use these fns, but now we have good replacements
+   for snprintf and vsnprintf */
+#define slprintf snprintf
+#define vslprintf vsnprintf
+
 #endif /* _INCLUDES_H */
 
index 62f8df2b03d14ecd6e521cec1fc4cdd20ff8f726..12a63ca23c3972a95aca42f6348b106438dada86 100644 (file)
@@ -213,10 +213,6 @@ void CatchSignal(int signum,void (*handler)(int ));
 void CatchChild(void);
 void CatchChildLeaveStatus(void);
 
-/*The following definitions come from  lib/slprintf.c  */
-
-int vslprintf(char *str, int n, char *format, va_list ap);
-
 /*The following definitions come from  lib/smbrun.c  */
 
 int smbrun(char *cmd, int *outfd);
index 0b52d625131885dc35f12094948126ed41fcc682..6824a0edf44998864dcc8f3ac148e8218a50aa04 100644 (file)
@@ -33,7 +33,7 @@ SEC_DESC *cli_query_secdesc(struct cli_state *cli,int fd)
        char param[8];
        char *rparam=NULL, *rdata=NULL;
        int rparam_count=0, rdata_count=0;
-       TALLOC_CTX *mem_ctx;
+       TALLOC_CTX *mem_ctx=NULL;
        prs_struct pd;
        SEC_DESC *psd = NULL;
 
index 6636285b6f7b256c8a26141e129a0f9bdd769ab2..0e0f9908dcb3d40c916fb2094125ad6305f31a1e 100644 (file)
@@ -108,7 +108,8 @@ void pdb_init_sam(SAM_ACCOUNT *user)
        ZERO_STRUCTP(user);
 
        user->mem_ctx = talloc_init();
-       DEBUG(10, ("pdb_init_sam: obtained a talloc context of 0x%x\n", user->mem_ctx));
+       DEBUG(10, ("pdb_init_sam: obtained a talloc context of 0x%x\n", 
+                  (unsigned)user->mem_ctx));
 
        user->logon_time            = (time_t)0;
        user->logoff_time           = (time_t)-1;
@@ -134,7 +135,7 @@ void pdb_clear_sam(SAM_ACCOUNT *user)
                return;
 
        /* free upany memory used */
-       DEBUG(10, ("pdb_clear_sam: releasing memory.  talloc context is 0x%x\n",user->mem_ctx));
+       DEBUG(10, ("pdb_clear_sam: releasing memory.  talloc context is 0x%x\n",(unsigned)user->mem_ctx));
        talloc_destroy (user->mem_ctx);
                
        /* now initialize */
index 15e8e9537ea5f5505514a08d855688c0a1165bd5..61b9390d0837ecb3e383952a199e64b1a313a33a 100644 (file)
@@ -556,7 +556,7 @@ static BOOL check_server_security(char *orig_user, char *domain, char *unix_user
                             smb_apasswd, smb_apasslen, 
                             smb_ntpasswd, smb_ntpasslen);
   if(ret) {
-    struct passwd *pwd;
+    struct passwd *pwd=NULL;
 
     /*
      * User validated ok against Domain controller.
@@ -597,7 +597,7 @@ static BOOL check_domain_security(char *orig_user, char *domain, char *unix_user
 {
   BOOL ret = False;
   BOOL user_exists = True;
-  struct passwd *pwd;
+  struct passwd *pwd=NULL;
 
   if(lp_security() != SEC_DOMAIN)
     return False;