Commit df1d2083 authored by Jenda's avatar Jenda

make gcc 4.8 happy again

parent 22898651
......@@ -11,10 +11,10 @@ c2s.pb-c.c:
protoc-c --c_out=. c2s.proto
%.o: %.c
$(CPP) $(CFLAGS) -c $< -o $@ $(INC)
$(CPP) -c $< -o $@ $(INC) $(CFLAGS)
server: c2s.pb-c.c $(OTHINGS)
$(CPP) $(CFLAGS) $(OTHINGS) -o server
$(CPP) $(OTHINGS) -o server $(CFLAGS)
clean:
rm -fr *.o server c2s.pb-c.h c2s.pb-c.c
......
......@@ -3,6 +3,7 @@
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include <err.h>
#include "client_parser.h"
#include "xlate_worker.h"
......@@ -312,7 +313,9 @@ int parse_client_req(tcp_cli_t * me, const uint8_t * buf2, int32_t len) {
}
rec_stop = s->stopframe;
asprintf(&recpath, "rec-%li-%i", time(0), samplerate);
if(asprintf(&recpath, "rec-%li-%i", time(0), samplerate) == -1) {
err(1, "asprintf");
}
pthread_mutex_unlock(&datamutex);
......
......@@ -98,8 +98,12 @@ void * sdr_read_thr(void * a) {
char * cfilepath;
char * metapath;
asprintf(&cfilepath, "%s.cfile", recpath);
asprintf(&metapath, "%s.txt", recpath);
if(asprintf(&cfilepath, "%s.cfile", recpath) == -1) {
err(1, "asprintf");
}
if(asprintf(&metapath, "%s.txt", recpath) == -1) {
err(1, "asprintf");
}
FILE * cfile = fopen(cfilepath, "ab");
FILE * metafile = fopen(metapath, "ab");
......@@ -112,11 +116,15 @@ void * sdr_read_thr(void * a) {
fwrite(p->data, SDRPACKETSIZE*COMPLEX * sizeof(float), 1, cfile);
char * metaline;
asprintf(&metaline, "block %zu time %i freq %" PRId64 "\n",
int ret = asprintf(&metaline, "block %zu time %i freq %" PRId64 "\n",
SDRPACKETSIZE*COMPLEX * sizeof(float),
p->timestamp,
p->frequency);
if(ret == -1) {
err(1, "asprintf");
}
fwrite(metaline, strlen(metaline), 1, metafile);
free(metaline);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment