mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-12 20:46:39 +02:00
26 lines
1.2 KiB
Diff
26 lines
1.2 KiB
Diff
Fix -Wimplicit-function-declaration error with gcc 14.
|
|
|
|
```
|
|
./cli/cli.c: In function 'parse_config':
|
|
./cli/cli.c:311:33: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
|
|
311 | if (strncasecmp(basename(argv[0]), "care", strlen("care")) == 0)
|
|
| ^~~~~~~~
|
|
./cli/cli.c:311:33: error: passing argument 1 of 'strncasecmp' makes pointer from integer without a cast [-Wint-conversion]
|
|
311 | if (strncasecmp(basename(argv[0]), "care", strlen("care")) == 0)
|
|
| ^~~~~~~~~~~~~~~~~
|
|
| |
|
|
| int
|
|
```
|
|
|
|
--- proot-5.4.0-origin/src/cli/cli.c
|
|
+++ proot-5.4.0/src/cli/cli.c
|
|
@@ -23,7 +23,8 @@
|
|
#include <stdio.h> /* printf(3), */
|
|
#include <stdbool.h> /* bool, true, false, */
|
|
#include <linux/limits.h> /* ARG_MAX, PATH_MAX, */
|
|
-#include <string.h> /* str*(3), basename(3), */
|
|
+#include <libgen.h> /* basename(), */
|
|
+#include <string.h> /* str*(3), */
|
|
#include <talloc.h> /* talloc*, */
|
|
#include <stdlib.h> /* exit(3), EXIT_*, strtol(3), {g,s}etenv(3), */
|
|
#include <assert.h> /* assert(3), */
|