Commit 1461a737 authored by conrad's avatar conrad

remove strsep from oggz-info.c

For portability, to mingw. Reported by Frank Barchard:
http://lists.xiph.org/pipermail/ogg-dev/2009-June/001483.html
parent 6421716a
......@@ -274,6 +274,7 @@ static int
ot_fisbone_print(OI_Info * info, OI_TrackInfo *oit) {
char *allocated, *messages, *token;
size_t len;
if (oit->has_fisbone) {
printf("\n\tExtra information from Ogg Skeleton track:\n");
......@@ -288,16 +289,24 @@ ot_fisbone_print(OI_Info * info, OI_TrackInfo *oit) {
printf ("\n");
printf("\tPreroll: %d\n", oit->fbInfo.preroll);
allocated = messages = _ogg_calloc(oit->fbInfo.current_header_size+1, sizeof(char));
len = oit->fbInfo.current_header_size+1;
allocated = messages = _ogg_calloc(len, sizeof(char));
if (messages == NULL) return OIT_OOM;
strcpy(messages, oit->fbInfo.message_header_fields);
strncpy(messages, oit->fbInfo.message_header_fields, len);
messages[len-1] = '\0';
printf("\tMessage Header Fields:\n");
while (1) {
token = strsep(&messages, "\n\r");
token = strchr(messages, '\r');
if (token == NULL)
break;
*token = '\0';
printf("\t %s", token);
if (messages == NULL)
break;
token++;
if (*token == '\n')
token++;
messages = token;
}
printf("\n");
_ogg_free(allocated);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment