Skip to content

Commit

Permalink
Merge remote-tracking branch 'jon/jonwright-patch-1' into 571_debian_…
Browse files Browse the repository at this point in the history
…report
  • Loading branch information
kif committed Jun 2, 2024
2 parents 50b28f2 + e8e287c commit ca6f4d2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/fabio/ext/src/columnfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ FILE* fn_fopen(const char* fname, const char* mode)

#include "columnfile.h"

static char hdr_ctl[]="# %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s";
/* 32 conversions for sscanf below = 8*4 */
static char hdr_ctl[]="# "
"%s %s %s %s "
"%s %s %s %s "
"%s %s %s %s "
"%s %s %s %s "
"%s %s %s %s "
"%s %s %s %s "
"%s %s %s %s "
"%s %s %s %s ";



Expand Down Expand Up @@ -158,8 +167,8 @@ void *cf_read_ascii(void *fp, void *dest, unsigned int FLAGS){/*{{{*/
}

/*try to sscanf it using 32 conversions - if that doesn't work use pedestrian version*/
ncols=sscanf_s(line,hdr_ctl,repeat16_inc(clabels,0),repeat16_inc(clabels,16),*(clabels+32));
if (ncols==32+1 || ncols==0){
ncols=sscanf_s(line,hdr_ctl,repeat16_inc(clabels,0),repeat16_inc(clabels,16));
if (ncols==32 || ncols==0){
/*aha we probably didn't get it all*/
/*step through buffer with char ptr and check for whitespace->non-ws slopes. when one is found read from pc-1 into header storage. exit when line is exhausted*/
/*count the number of entries*/
Expand Down

0 comments on commit ca6f4d2

Please sign in to comment.