comparison src/itemlist.c @ 281:5eece4dfd945 noffle

[svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors and exiting, Log_gdbm_fatal() for the the same but specifically as a GDBM error reporting function, and a new log debug level AUTH for a forthcoming authentication mechanism. * src/database.c,src/group.c: Provide new gdbm error function to all gdbm opens. * src/noffle.c: Add atexit() to always close databases on a program- inspired exit. * src/content.c,src/dynamicstring.c,src/fetchlist.c,src/filter.c, src/itemlist.c,src/log.c,src/log.h,src/over.c,src/protocol.h, src/request.c,src/util.c: Use Log_fatal where appropriate.
author bears
date Fri, 27 Dec 2002 21:48:25 +0000
parents 24d4cd032da5
children b540ecb6f218
comparison
equal deleted inserted replaced
280:9c54bf672ca1 281:5eece4dfd945
1 /* 1 /*
2 itemlist.c 2 itemlist.c
3 3
4 $Id: itemlist.c 316 2001-10-31 11:44:53Z bears $ 4 $Id: itemlist.c 413 2002-12-27 21:48:25Z bears $
5 */ 5 */
6 6
7 #if HAVE_CONFIG_H 7 #if HAVE_CONFIG_H
8 #include <config.h> 8 #include <config.h>
9 #endif 9 #endif
37 char *p; 37 char *p;
38 Bool inItem; 38 Bool inItem;
39 39
40 res = malloc( sizeof( ItemList ) ); 40 res = malloc( sizeof( ItemList ) );
41 if ( res == NULL ) 41 if ( res == NULL )
42 { 42 Log_fatal( "Malloc of ItemList failed." );
43 Log_err( "Malloc of ItemList failed." );
44 exit( EXIT_FAILURE );
45 }
46 43
47 res->list = malloc ( strlen(list) + 2 ); 44 res->list = malloc ( strlen(list) + 2 );
48 if ( res->list == NULL ) 45 if ( res->list == NULL )
49 { 46 Log_fatal( "Malloc of ItemList.list failed." );
50 Log_err( "Malloc of ItemList.list failed." );
51 exit( EXIT_FAILURE );
52 }
53 strcpy( res->list, list ); 47 strcpy( res->list, list );
54 48
55 res->count = 0; 49 res->count = 0;
56 res->next = res->list; 50 res->next = res->list;
57 51