Skip to content

Commit 7aab08e

Browse files
committed
Add -Wall to compilation flags
Fix resulting warning, restructure code slightly for readability.
1 parent 41e9681 commit 7aab08e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818

1919
CC = gcc
20-
CFLAGS = -shared -fPIC
20+
CFLAGS = -shared -fPIC -Wall
2121
LDFLAGS = -ldl
2222

2323
.PHONY: all

libdropbox_fs_fix.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,16 @@ int statfs64(const char *path, struct statfs64 *buf) {
5656
char *dup = strdup(path);
5757
char *dname = dirname(dup);
5858

59-
if (canary_path = malloc(strlen(dname) + strlen(CANARY_FILE_PREFIX) + 1)) {
59+
canary_path = malloc(strlen(dname) + strlen(CANARY_FILE_PREFIX) + 1);
60+
if (canary_path) {
6061
strcpy(canary_path, dname);
6162
strcat(canary_path, CANARY_FILE_PREFIX);
63+
#ifdef DEBUG
64+
fprintf(stderr, " LEARNED canary path: %s\n", canary_path);
65+
#endif
6266
}
6367

6468
free(dup);
65-
#ifdef DEBUG
66-
fprintf(stderr, " LEARNED canary path: %s\n", canary_path);
67-
#endif
6869
}
6970
}
7071
return retval;

0 commit comments

Comments
 (0)