1
0
Fork 0

Compare commits

..

No commits in common. "fa589f31229a65b199cd3d7e987efd5989e08816" and "a2e0694efc9ced1e71762837bc0adecc842737e3" have entirely different histories.

2 changed files with 2 additions and 10 deletions

View File

@ -46,12 +46,9 @@ int addrbook_load(addrbook_t *ab, FILE *in) {
char *line = NULL;
size_t line_len = 0;
size_t lines = 0;
while (getline(&line, &line_len, in) != -1) {
++lines;
}
if (lines == 0)
return -1;
while (getline(&line, &line_len, in) != -1)
++lines;
if (ab->entries != NULL)
free(ab->entries);

View File

@ -4,7 +4,6 @@
#include "net.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#define CHANNELS 1
#define SAMPLE_RATE 48000
@ -25,10 +24,6 @@ int main(int argc, char **argv) {
addrbook_t ab = {0};
FILE *in = fopen("addressbook_key", "r");
if (in == NULL) {
fprintf(stderr, "An addressbook file wasn't open: %s\n", strerror(errno));
return 1;
}
addrbook_load(&ab, in);