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

Diff for /src/usr.bin/mktemp/mktemp.c between version 1.19 and 1.20

version 1.19, 2013/03/14 15:44:15 version 1.20, 2013/08/06 21:56:51
Line 73 
Line 73 
                 usage();                  usage();
         }          }
   
           len = strlen(template);
           if (len < 6 || strcmp(&template[len - 6], "XXXXXX")) {
                   fatalx("insufficient number of Xs in template `%s'",
                       template);
           }
         if (tflag) {          if (tflag) {
                 if (strchr(template, '/')) {                  if (strchr(template, '/')) {
                         fatalx("template must not contain directory "                          fatalx("template must not contain directory "
Line 88 
Line 93 
   
                 if (asprintf(&tempfile, "%.*s/%s", (int)len, prefix, template) < 0)                  if (asprintf(&tempfile, "%.*s/%s", (int)len, prefix, template) < 0)
                         tempfile = NULL;                          tempfile = NULL;
         } else {          } else
                 len = strlen(template);  
                 if (len < 6 || strcmp(&template[len - 6], "XXXXXX")) {  
                         fatalx("insufficient number of Xs in template `%s'",  
                             template);  
                 }  
                 tempfile = strdup(template);                  tempfile = strdup(template);
         }  
         if (tempfile == NULL)          if (tempfile == NULL)
                 fatalx("cannot allocate memory");                  fatalx("cannot allocate memory");
   

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20