Difference for common/porting.c from version 1.25 to 1.26


version 1.25 version 1.26
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_porting_c =   * static char *rcsid_porting_c =
  *   "$Id: porting.c,v 1.25 2005/04/27 06:39:50 mwedel Exp $";   *   "$Id: porting.c,v 1.26 2005/08/12 08:18:59 ryo_saeba Exp $";
  */   */
   
 /*  /*
Line 73
 
Line 73
  * at some unix variants.   * at some unix variants.
  */   */
   
 char *tempnam_local(char *dir, char *pfx)  char *tempnam_local(const char *dir, const char *pfx)
 {  {
     char *f, *name;      char *name;
     pid_t pid=getpid();      pid_t pid=getpid();
   
 /* HURD does not have a hard limit, but we do */  /* HURD does not have a hard limit, but we do */
Line 94
 
Line 94
      * already exists - if so, we'll just keep looking - eventually we should       * already exists - if so, we'll just keep looking - eventually we should
      * find one that is free.       * find one that is free.
      */       */
     if ((f = (char *)dir)!=NULL) {      if (dir!=NULL) {
  do {   do {
 #ifdef HAVE_SNPRINTF  #ifdef HAVE_SNPRINTF
      (void)snprintf(name, MAXPATHLEN, "%s/%s%hx.%d", f, pfx, pid, curtmp);       (void)snprintf(name, MAXPATHLEN, "%s/%s%hx.%d", dir, pfx, pid, curtmp);
 #else  #else
      (void)sprintf(name,"%s/%s%hx%d", f, pfx, pid, curtmp);       (void)sprintf(name,"%s/%s%hx%d", dir, pfx, pid, curtmp);
 #endif  #endif
      curtmp++;       curtmp++;
  } while (access(name, F_OK)!=-1);   } while (access(name, F_OK)!=-1);
Line 221
 
Line 221
  * A replacement of strdup(), since it's not defined at some   * A replacement of strdup(), since it's not defined at some
  * unix variants.   * unix variants.
  */   */
 char *strdup_local(char *str) {  char *strdup_local(const char *str) {
   char *c=(char *)malloc(sizeof(char)*(strlen(str)+1));    char *c=(char *)malloc(sizeof(char)*(strlen(str)+1));
   strcpy(c,str);    strcpy(c,str);
   return c;    return c;


Legend:
line(s) removed in v.1.25 
line(s) changed
 line(s) added in v.1.26

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:16