-CFLAGS=-Wall -std=c99 -Ilib -Ielf -I. -Ilzma/api
+CFLAGS=-Wall -W -Wextra -Werror -std=c99 -Ilib -Ielf -I. -Ilzma/api
LZMAFLAGS=-Ilzma/api -Ilzma/tuklib -Ilzma/lzma -Ilzma/common -Ilzma/check -Ilzma/lz -Ilzma/rangecoder -Ilzma/simple -Ilzma/delta -DHAVE_CHECK_CRC64 -DHAVE_CHECK_CRC32 -DHAVE_ENCODER_LZMA2 -DHAVE_DECODER_LZMA2 -DHAVE_MF_BT4
echo ", 0};" >> $@
lib/sqlite3.o: lib/sqlite3.c lib/config.h
- $(CC) $(CFLAGS) -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
+ $(CC) -Wall -std=c99 -Ilib -D_HAVE_SQLITE_CONFIG_H=1 -c -o $@ $<
$(LZMAOBJ):
$(CC) $(CFLAGS) $(LZMAFLAGS) -c -o $@ $*.c
char *name, *dynname;
Elf64_Dyn *dent;
+ if (ac < 2) {
+ fprintf(stderr, "usage: soname <file>\n");
+ exit(EXIT_FAILURE);
+ }
+
if (lstat(av[1], &sbuf) == -1) {
exit(1);
}
exit(1);
}
/* not at least the size of the elf header? */
- if (sbuf.st_size < sizeof(Elf64_Ehdr)) {
+ if ((size_t)sbuf.st_size < sizeof(Elf64_Ehdr)) {
exit(1);
}
static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
+ NotUsed = 0; /* suppress warning */
for(i=0; i<argc; i++){
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
/* now, parse the options, return optind so the caller can adjust if needed */
- return 1;
+ return av ? ac : 1;
}
int zpm_extract(struct zpm *pkg, char *hash, char *path, int mode) {
//fprintf(stderr, "uncompressing %d bytes at %p, expect %lld\n", blobsize, xzdata, (long long int)size);
uncompresslzma(xzdata, blobsize, out);
fclose(out);
+ chmod(path, mode);
sqlite3_finalize(ifile);
}
hash[64] = 0;
munmap(content, sbuf.st_size);
- return 1;
+ return flags ? fd : 1;
}
static sqlite3_stmt *run_for_hash(sqlite3 *db, char *sql, char *hash) {
hash = hashbuf;
}
+ flags = 0; /* suppress warning, probably use to follow symlinks */
/* mmap the file */
fd = open(path, O_RDONLY);
if (fd == -1) {