[Git][cmucl/cmucl][issue-130-file-author-in-c] Use strdup to copy the author field.

Raymond Toy (@rtoy) gitlab at common-lisp.net
Fri Sep 2 17:21:43 UTC 2022



Raymond Toy pushed to branch issue-130-file-author-in-c at cmucl / cmucl


Commits:
a6ef2b38 by Raymond Toy at 2022-09-02T10:21:26-07:00
Use strdup to copy the author field.

- - - - -


1 changed file:

- src/lisp/os-common.c


Changes:

=====================================
src/lisp/os-common.c
=====================================
@@ -782,10 +782,7 @@ os_file_author(const char *path)
     }
     
     if (result) {
-        author = malloc(strlen(result->pw_name) + 1);
-        if (author) {
-            strcpy(author, result->pw_name);
-        }
+        author = strdup(result->pw_name);
     }
 
     if (buf) {



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a6ef2b384cc21b539b90aba968da4f02bd800096

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/a6ef2b384cc21b539b90aba968da4f02bd800096
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20220902/f264d022/attachment.html>


More information about the cmucl-cvs mailing list