Resolve compiler warning

This commit is contained in:
Night Kaly 2024-11-04 23:15:43 +00:00
parent a97b6fb97a
commit 87dc1a0d89
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM
2 changed files with 8 additions and 7 deletions

View file

@ -9,7 +9,7 @@ BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
LDFLAGS != pkg-config --libs libsodium
CFLAGS = -O3 -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall
CFLAGS = -O3 -march=native -mtune=native -pipe -s -std=c99 -pedantic -Wall -D_DEFAULT_SOURCE
SRC = apm.c

13
apm.c
View file

@ -7,6 +7,8 @@
#include <time.h>
#include <sys/stat.h>
#include <sys/resource.h>
#include <linux/limits.h>
#include <sodium.h>
#include "arg.h"
@ -18,6 +20,7 @@
char *argv0;
void die(char *str);
char *get_master_key(void);
void *memalloc(size_t size)
{
@ -29,9 +32,7 @@ void *memalloc(size_t size)
return ptr;
}
char *get_master_key();
void usage()
void usage(void)
{
printf("Usage: %s [-vhL] [[-e | -R | -I | -Q] <password>] [-M <file>] [-G <password> <length>]\n", argv0);
exit(EXIT_SUCCESS);
@ -87,7 +88,7 @@ void tree(const char *basepath, int depth)
closedir(dir);
}
char *get_apm()
char *get_apm(void)
{
char dirname[] = "apm";
const char *apm_dir = getenv("APM_DIR");
@ -138,7 +139,7 @@ char *get_passfile(const char *key)
return path;
}
char *get_password()
char *get_password(void)
{
size_t len;
char *password = NULL;
@ -273,7 +274,7 @@ void decrypt_password(const char *name, int open)
fclose(file);
}
char *get_master_key()
char *get_master_key(void)
{
char *key_path = getenv("APM_KEY");
char *m_key = NULL;