ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/misc.C
(Generate patch)

Comparing rxvt-unicode/src/misc.C (file contents):
Revision 1.49 by ayin, Wed Oct 31 09:55:23 2007 UTC vs.
Revision 1.51 by ayin, Mon Jan 7 12:41:31 2008 UTC

285 for (l = 0, t = s; l < n; l++) 285 for (l = 0, t = s; l < n; l++)
286 { 286 {
287 for ( ; *t && *t != ','; t++) ; 287 for ( ; *t && *t != ','; t++) ;
288 p = t - s; 288 p = t - s;
289 ret[l] = (char *)malloc (p + 1); 289 ret[l] = (char *)malloc (p + 1);
290 strncpy (ret[l], s, p); 290 memcpy (ret[l], s, p);
291 ret[l][p] = '\0'; 291 ret[l][p] = '\0';
292 rxvt_strtrim (ret[l]); 292 rxvt_strtrim (ret[l]);
293 s = ++t; 293 s = ++t;
294 } 294 }
295 295
303 free (cs[i]); 303 free (cs[i]);
304 304
305 free (cs); 305 free (cs);
306} 306}
307 307
308void *
309rxvt_malloc (size_t size)
310{
311 void *p = malloc (size);
308 312
313 if (!p)
314 rxvt_fatal ("memory allocation failure. aborting.\n");
309 315
316 return p;
317}
318
319void *
320rxvt_calloc (size_t number, size_t size)
321{
322 void *p = calloc (number, size);
323
324 if (!p)
325 rxvt_fatal ("memory allocation failure. aborting.\n");
326
327 return p;
328}
329
330void *
331rxvt_realloc (void *ptr, size_t size)
332{
333 void *p = realloc (ptr, size);
334
335 if (!p)
336 rxvt_fatal ("memory allocation failure. aborting.\n");
337
338 return p;
339}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines