From 89c72aba05090a7667b75581bf81350141e83297 Mon Sep 17 00:00:00 2001 From: Martin Mathieson Date: Thu, 8 Jan 2009 16:29:15 +0000 Subject: [PATCH] Fix a bug where a space character wasn't being written back to save files. svn path=/trunk/; revision=27198 --- wiretap/catapult_dct2000.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wiretap/catapult_dct2000.c b/wiretap/catapult_dct2000.c index bfef5c99bf..88e01a0c1a 100644 --- a/wiretap/catapult_dct2000.c +++ b/wiretap/catapult_dct2000.c @@ -391,9 +391,9 @@ gboolean catapult_dct2000_read(wtap *wth, int *err, gchar **err_info _U_, line_prefix_info = g_malloc(sizeof(line_prefix_info_t)); /* Create and use buffer for contents before time */ - line_prefix_info->before_time = g_malloc(before_time_offset+1); - g_strlcpy(line_prefix_info->before_time, linebuff, before_time_offset); - line_prefix_info->before_time[before_time_offset] = '\0'; + line_prefix_info->before_time = g_malloc(before_time_offset+2); + g_strlcpy(line_prefix_info->before_time, linebuff, before_time_offset+1); + line_prefix_info->before_time[before_time_offset+1] = '\0'; /* Create and use buffer for contents before time. Do this only if it doesn't correspond to " l ", which is by far the most @@ -1131,12 +1131,15 @@ gboolean parse_line(gint line_length, gint *seconds, gint *useconds, { return FALSE; } + /* Skip it */ + n++; /*********************************************************************/ /* Find and read the timestamp */ /* Now scan to the next digit, which should be the start of the timestamp */ + /* This will involve skipping " tm " */ for (; !isdigit((guchar)linebuff[n]) && (n < line_length); n++); if (n >= line_length) {