- uint8_t *endp = memmem(&data[pos], outer_end - pos, "\5\0\0\0\4", 5);
- assert(endp);
-
- int end = endp - data;
- if (pos != end)
+ /* There might be a pair of strings representing a dataset and
+ datafile name, or there might be a set of custom currency strings.
+ The custom currency strings start with a pair of integers, so we
+ can distinguish these from a string by checking for a null byte; a
+ small 32-bit integer will always contain a null and a text string
+ never will. */
+ int save_pos = pos;
+ int len = get_u32();
+ bool has_dataset = !memchr(&data[pos], '\0', len);
+ pos = save_pos;
+
+ if (has_dataset)