[email protected]
[Top] [All Lists]

PERFORCE change 114875 for review

Subject: PERFORCE change 114875 for review
From: Todd Miller
Date: Fri, 23 Feb 2007 16:51:00 GMT
http://perforce.freebsd.org/chv.cgi?CH=114875

Change 114875 by [email protected]_macbook on 2007/02/23 16:50:50

        Use strdupa() now that we have it in libsecompat

Affected files ...

.. 
//depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#6
 edit

Differences ...

==== 
//depot/projects/trustedbsd/sedarwin8/policies/sedarwin/policycoreutils/restorecon/restorecon.c#6
 (text+ko) ====

@@ -177,16 +177,14 @@
                                "Warning! %s refers to a symbolic link, not 
following last component.\n",
                                filename);
                char *p = NULL, *file_sep;
-               char *tmp_path;
+               char *tmp_path = strdupa(filename);
                size_t len = 0;
 
-               tmp_path = alloca(strlen(filename) + 1);
                if (!tmp_path) {
                        fprintf(stderr, "strdupa on %s failed:  %s\n", filename,
                                strerror(errno));
                        return 1;
                }
-               strcpy(tmp_path, filename);
                file_sep = strrchr(tmp_path, '/');
                if (file_sep == tmp_path) {
                        file_sep++;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 114875 for review, Todd Miller <=