diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2009-08-21 02:56:18 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2009-08-21 02:56:18 +0200 |
commit | 0fc3b739cfc0b3b59ee6f5f5ff20bf343a82b98d (patch) | |
tree | d6f17c637bfd78f93f4d97422fe616589f9e02d7 | |
parent | 07e2208a51d7bc64d4639c6eb56a4c33d8d87d7d (diff) |
Return a pointer to the nick struct or NULL in nick_add.
-rw-r--r-- | nick.c | 6 | ||||
-rw-r--r-- | nick.h | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -11,12 +11,12 @@ void nick_init() { nicks = NULL; } -int nick_add(char *name) { +struct nick_t *nick_add(char *name) { struct nick_t *nick = malloc(sizeof(struct nick_t)); if(!nick) { char *error = strerror(errno); fprintf(stderr, "Could not allocate memory for nick: %s\n", error); - return 0; + return NULL; } if(nicks) { @@ -30,7 +30,7 @@ int nick_add(char *name) { nick->regexes = NULL; nick->next = NULL; - return 1; + return nick; } int nick_regex_add(struct nick_t *nick, char *re_s) { @@ -13,7 +13,7 @@ struct nick_t { }; void nick_init(); -int nick_add(char *name); +struct nick_t *nick_add(char *name); int nick_regex_add(struct nick_t *nick, char *re_s); void nick_free(); |