/[gnokii]/gnokii/common/cfgreader.c
ViewVC logotype

Diff of /gnokii/common/cfgreader.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.59 by pkot, Mon May 9 20:55:00 2005 UTC revision 1.60 by pkot, Mon May 16 08:50:17 2005 UTC
# Line 36  Line 36 
36    
37  */  */
38    
   
 /* for strndup */  
 #define _GNU_SOURCE  
39  #include "config.h"  #include "config.h"
40  #include "compat.h"  #include "compat.h"
41  #include "misc.h"  #include "misc.h"
# Line 240  struct gn_cfg_header *cfg_file_read(cons Line 237  struct gn_cfg_header *cfg_file_read(cons
237                  }                  }
238    
239                  num_lines++;                  num_lines++;
240                  buf = (char *)strndup(line_begin, line_end - line_begin);                  buf = malloc(line_end - line_begin + 1);
241                    strncpy(buf, line_begin, line_end - line_begin);
242                    buf[line_end - line_begin] = 0;
243                  split_lines = realloc(split_lines,                  split_lines = realloc(split_lines,
244                                  (num_lines + 1) * sizeof(char*));                                  (num_lines + 1) * sizeof(char*));
245                  split_lines[num_lines - 1] = buf;                  split_lines[num_lines - 1] = buf;

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26