[BACK]Return to alloc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Diff for /src/usr.bin/sudo/Attic/alloc.c between version 1.8 and 1.9

version 1.8, 2004/09/28 15:10:50 version 1.9, 2007/07/26 16:10:15
Line 1 
Line 1 
 /*  /*
  * Copyright (c) 1999-2003 Todd C. Miller <Todd.Miller@courtesan.com>   * Copyright (c) 1999-2005 Todd C. Miller <Todd.Miller@courtesan.com>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 18 
Line 18 
  * Materiel Command, USAF, under agreement number F39502-99-1-0512.   * Materiel Command, USAF, under agreement number F39502-99-1-0512.
  */   */
   
 #include "config.h"  #include <config.h>
   
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/param.h>  #include <sys/param.h>
Line 50 
Line 50 
 #include "sudo.h"  #include "sudo.h"
   
 #ifndef lint  #ifndef lint
 static const char rcsid[] = "$Sudo: alloc.c,v 1.23 2004/06/01 16:23:32 millert Exp $";  __unused static const char rcsid[] = "$Sudo: alloc.c,v 1.23.2.3 2007/06/12 01:43:01 millert Exp $";
 #endif /* lint */  #endif /* lint */
   
 /*  /*
Line 179 
Line 179 
 #ifdef __STDC__  #ifdef __STDC__
 easprintf(char **ret, const char *fmt, ...)  easprintf(char **ret, const char *fmt, ...)
 #else  #else
 easprintf(va_alist)  easprintf(ret, fmt, va_alist)
       char **ret;
       const char *fmt;
     va_dcl      va_dcl
 #endif  #endif
 {  {
Line 188 
Line 190 
 #ifdef __STDC__  #ifdef __STDC__
     va_start(ap, fmt);      va_start(ap, fmt);
 #else  #else
     char **ret;  
     const char *fmt;  
   
     va_start(ap);      va_start(ap);
     ret = va_arg(ap, char **);  
     fmt = va_arg(ap, const char *);  
 #endif  #endif
     len = vasprintf(ret, fmt, ap);      len = vasprintf(ret, fmt, ap);
     va_end(ap);      va_end(ap);
Line 218 
Line 215 
     if ((len = vasprintf(ret, format, args)) == -1)      if ((len = vasprintf(ret, format, args)) == -1)
         errx(1, "unable to allocate memory");          errx(1, "unable to allocate memory");
     return(len);      return(len);
   }
   
   /*
    * Wrapper for free(3) so we can depend on C89 semantics.
    */
   void
   efree(ptr)
       VOID *ptr;
   {
       if (ptr != NULL)
           free(ptr);
 }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9