aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakanori Nakane <nakane.t@gmail.com>2014-10-30 14:02:59 +0900
committerThomas White <taw@physics.org>2015-02-11 14:00:36 +0100
commit587c1ef949cce26be9e528414b8b377a6598cb04 (patch)
tree9e82fdecbb9f3784b4bf52645935099aa121b74e
parent1f318fdd6585cb9e825ddf90af749b5266d17b53 (diff)
Fix an infinite loop in the parsing of an event string.
-rw-r--r--libcrystfel/src/events.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libcrystfel/src/events.c b/libcrystfel/src/events.c
index b008eee6..29cb9495 100644
--- a/libcrystfel/src/events.c
+++ b/libcrystfel/src/events.c
@@ -412,16 +412,13 @@ struct event *get_event_from_event_string(const char *ev_string)
if ( ev == NULL ) return NULL;
if ( strlen(buf_path) !=0 ) {
-
+ start = buf_path;
do {
-
- start = buf_path;
-
char buf[2014];
sep = strstr(start, "/");
- if ( sep != NULL ) {
+ if ( sep != NULL ) {
strncpy(buf, start, sep-start);
buf[sep-start]='\0';
push_path_entry_to_event(ev, buf);
@@ -462,6 +459,7 @@ struct event *get_event_from_event_string(const char *ev_string)
push_dim_entry_to_event(ev, buf_int);
}
+
} while (sep);
}