diff options
author | Thomas White <taw@physics.org> | 2021-07-23 13:38:18 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2021-07-23 13:38:18 +0200 |
commit | dc97d48e3825cb85eaacad2d0ef88ed9436ac1f4 (patch) | |
tree | e4a79d1921bfd138b3308e9ebe251b0e6cffed54 /libcrystfel | |
parent | a62320ae32632ce6e3a5cfc5ccecf7fac1eb04f7 (diff) |
Add field widths to all sscanf("%s")
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/reflist-utils.c | 4 | ||||
-rw-r--r-- | libcrystfel/src/stream.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libcrystfel/src/reflist-utils.c b/libcrystfel/src/reflist-utils.c index 52cf5e61..21662edb 100644 --- a/libcrystfel/src/reflist-utils.c +++ b/libcrystfel/src/reflist-utils.c @@ -351,7 +351,7 @@ static RefList *read_reflections_from_file(FILE *fh, char **sym) int cts; int r; - r = sscanf(line, "%i %i %i %f %s %f %i", + r = sscanf(line, "%i %i %i %f %64s %f %i", &h, &k, &l, &intensity, phs, &sigma, &cts); if ( r != 7 ) { @@ -380,7 +380,7 @@ static RefList *read_reflections_from_file(FILE *fh, char **sym) int cts; int r; - r = sscanf(line, "%i %i %i %f %s %f %i %f %f", + r = sscanf(line, "%i %i %i %f %64s %f %i %f %f", &h, &k, &l, &intensity, phs, &sigma, &cts, &fs, &ss); diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c index d0dbe540..3b439e5a 100644 --- a/libcrystfel/src/stream.c +++ b/libcrystfel/src/stream.c @@ -128,7 +128,7 @@ static ImageFeatureList *read_peaks(Stream *st, } if ( AT_LEAST_VERSION(st, 2, 3) ) { - r = sscanf(line, "%f %f %f %f %s", + r = sscanf(line, "%f %f %f %f %64s", &x, &y, &d, &intensity, panel_name); exp_n = 5; } else { @@ -240,7 +240,7 @@ static RefList *read_stream_reflections_2_3(Stream *st) char line[1024]; signed int h, k, l; float intensity, sigma, fs, ss, pk, bg; - char pname[32]; + char pname[64]; int r; rval = fgets(line, 1023, st->fh); @@ -250,7 +250,7 @@ static RefList *read_stream_reflections_2_3(Stream *st) if ( strcmp(line, STREAM_REFLECTION_END_MARKER) == 0 ) return out; - r = sscanf(line, "%i %i %i %f %f %f %f %f %f %s", + r = sscanf(line, "%i %i %i %f %f %f %f %f %f %63s", &h, &k, &l, &intensity, &sigma, &pk, &bg, &fs, &ss, pname); @@ -321,7 +321,7 @@ static RefList *read_stream_reflections_2_1(Stream *st) if ( strcmp(line, STREAM_REFLECTION_END_MARKER) == 0 ) return out; - r = sscanf(line, "%i %i %i %f %s %f %i %f %f", + r = sscanf(line, "%i %i %i %f %64s %f %i %f %f", &h, &k, &l, &intensity, phs, &sigma, &cts, &fs, &ss); if ( (r != 9) && (!first) ) { |