X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Foutput_gnuplot.c;h=43033777f4ee2abe1649c89b369f653fe4b4384f;hb=c91404191e6b31ffe40edd8de469876a02c81d57;hp=10b9c2647eea6bab64595cd6c2a77f0c5d298a29;hpb=809c5f2011198a064a2e5e4028f19e63eb532ec1;p=libsigrok.git diff --git a/output/output_gnuplot.c b/output/output_gnuplot.c index 10b9c264..43033777 100644 --- a/output/output_gnuplot.c +++ b/output/output_gnuplot.c @@ -27,11 +27,13 @@ struct context { unsigned int num_enabled_probes; unsigned int unitsize; - char *probelist[MAX_NUM_PROBES+1]; + char *probelist[SR_MAX_NUM_PROBES + 1]; char *header; }; -#define MAX_HEADER_LEN 1024 + (MAX_NUM_PROBES * (MAX_PROBENAME_LEN + 10)) +#define MAX_HEADER_LEN \ + (1024 + (SR_MAX_NUM_PROBES * (SR_MAX_PROBENAME_LEN + 10))) + const char *gnuplot_header = "\ # Sample data in space-separated columns format usable by gnuplot\n\ #\n\ @@ -141,7 +143,7 @@ static int event(struct sr_output *o, int event_type, char **data_out, return SR_OK; } -static int data(struct sr_output *o, char *data_in, uint64_t length_in, +static int data(struct sr_output *o, const char *data_in, uint64_t length_in, char **data_out, uint64_t *length_out) { struct context *ctx;