Browse Source

Fixed few minor errors

Piotr Czajkowski 6 years ago
parent
commit
9de8cd02ec
4 changed files with 5 additions and 5 deletions
  1. 1 1
      dict.c
  2. 1 1
      makefile
  3. 2 2
      xmlbuff.c
  4. 1 1
      zip.c

+ 1 - 1
dict.c

@@ -9,7 +9,7 @@ dictionary *dictionary_new (void){
 	static int dnf;
 	if (!dictionary_not_found) dictionary_not_found = &dnf;
 	dictionary *out= malloc(sizeof(dictionary));
-	*out= (dictionary){ };                          
+	*out= (dictionary){ .pairs=NULL };                          
 	return out;
 } 
 

+ 1 - 1
makefile

@@ -1,5 +1,5 @@
 P=anonymize
-CFLAGS=`pkg-config --cflags --libs libxml-2.0` -g -Wall -O3 -std=gnu99
+CFLAGS=`pkg-config --cflags --libs libxml-2.0` -g -Wall -Wextra -O3 -std=gnu99
 LDLIBS=`pkg-config --libs libxml-2.0` -larchive
 objects=keyval.o dict.o comments.o zip.o xmlbuff.o
 

+ 2 - 2
xmlbuff.c

@@ -2,8 +2,8 @@
 #include "xmlbuff.h"
 
 XMLBuff *XMLBuffNew(void) {
-	XMLBuff *out= malloc(sizeof(XMLBuff));
-	*out= (XMLBuff){ };                          
+	XMLBuff *out = malloc(sizeof(XMLBuff));
+	*out = (XMLBuff){ .data=NULL };                          
 	return out;
 }
 

+ 1 - 1
zip.c

@@ -29,7 +29,7 @@ static int rewriteZIP(struct archive *archiveIn, struct archive *archiveOut) {
 
 	while (archive_read_next_header(archiveIn, &entryIn) == ARCHIVE_OK) {
 		const char* path = archive_entry_pathname(entryIn);
-		size_t size = archive_entry_size(entryIn);
+		int64_t size = archive_entry_size(entryIn);
 		char buf[size];
 		Stopif(archive_read_data(archiveIn, buf, size) != size, return -2, "Archive entry has no size (%s)!\n", path);