memcpy() is quite a bit faster than g_strlcpy()!

svn path=/trunk/; revision=43675
This commit is contained in:
Martin Mathieson 2012-07-11 20:53:24 +00:00
parent 220958548c
commit e7b8e93e27
1 changed files with 2 additions and 3 deletions

View File

@ -407,7 +407,7 @@ catapult_dct2000_read(wtap *wth, int *err, gchar **err_info _U_,
/* Create and use buffer for contents before time */
line_prefix_info->before_time = g_malloc(before_time_offset+2);
g_strlcpy(line_prefix_info->before_time, linebuff, before_time_offset+1);
memcpy(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.
@ -421,8 +421,7 @@ catapult_dct2000_read(wtap *wth, int *err, gchar **err_info _U_,
else {
/* Allocate & write buffer for line between timestamp and data */
line_prefix_info->after_time = g_malloc(dollar_offset - after_time_offset);
g_strlcpy(line_prefix_info->after_time, linebuff+after_time_offset,
dollar_offset - after_time_offset);
memcpy(line_prefix_info->after_time, linebuff+after_time_offset, dollar_offset - after_time_offset);
line_prefix_info->after_time[dollar_offset - after_time_offset-1] = '\0';
}