diff options
| author | Ulf Hermann <[email protected]> | 2017-04-04 11:50:08 +0200 |
|---|---|---|
| committer | Ulf Hermann <[email protected]> | 2017-05-08 11:50:49 +0000 |
| commit | 99b4bda9c43ece1987212ddccecc3102488f3b09 (patch) | |
| tree | 460f780bad3d2421b8a90ec95c2192cc5032dd64 | |
| parent | 746d3918b520e6f45ecedab56e73576777d0b964 (diff) | |
Make unstrip compile on windows
strndupa doesn't exist, so we use strndup and free.
Change-Id: Ibb3fed05bcfcf9d74b31e5695e43e08766512cbf
Reviewed-by: Christian Kandeler <[email protected]>
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/unstrip.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1c67b57f..f3875097 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2017-05-04 Ulf Hermann <[email protected]> + * unstrip.c: Use strndup and free instead of strndupa. + +2017-05-04 Ulf Hermann <[email protected]> + * stack.c: Cast pid_t to int when printing using %d. 2017-05-04 Ulf Hermann <[email protected]> diff --git a/src/unstrip.c b/src/unstrip.c index 8d5414fa..6b4598c8 100644 --- a/src/unstrip.c +++ b/src/unstrip.c @@ -291,12 +291,13 @@ make_directories (const char *path) if (lastslash == path) return; - char *dir = strndupa (path, lastslash - path); + char *dir = strndup (path, lastslash - path); while (mkdir (dir, 0777) < 0 && errno != EEXIST) if (errno == ENOENT) make_directories (dir); else error (EXIT_FAILURE, errno, _("cannot create directory '%s'"), dir); + free (dir); } /* Keep track of new section data we are creating, so we can free it |
