Skip to content

Commit

Permalink
- Bug #24 fixed
Browse files Browse the repository at this point in the history
- Fixed compiler warnings
  • Loading branch information
Markus-Go committed Nov 6, 2015
1 parent a9f393f commit c87cddc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/bonesi.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "Can't open proc file system: %s. Make sure to disable rp_filter manually.\n", strerror( errno ));
}
else {
fgets(buf, 1023, f);
if (!fgets(buf, 1023, f)) {
fprintf(stderr, "Can't read proc file system. Permissions?");
}
rp_filter = atoi(buf);
fclose(f);
}
Expand Down
6 changes: 3 additions & 3 deletions src/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Url getURL(FILE *file){
u.host[0] = '\0';
u.path[0] = '\0';
u.protocol [0] = '\0';
fscanf(file, "%s\n", buffer);
if(sscanf(buffer,"%50[^:/]://%2000[^/]/%s", u.protocol, u.host, u.path) != 3) {
int r = fscanf(file, "%4096s\n", buffer);
if(sscanf(buffer,"%50[^:/]://%2000[^/]/%2000s", u.protocol, u.host, u.path) != 3) {
u.path[0] = '\0';
}
//sprintf(u.url, "%s/%s",u.host,u.path);
Expand All @@ -73,7 +73,7 @@ Url_array readURLs(const char* urlfilename, int verbose){
int url_count = 0;
char buffer[URL_SIZE];
while(!feof(file)){
fscanf(file, "%s\n", buffer);
int r = fscanf(file, "%4096s\n", buffer);
if(strlen(buffer) > 4) // > 4 'cause there are at least 4 characters in our template
url_count++;
}
Expand Down

0 comments on commit c87cddc

Please sign in to comment.