summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nick.c6
-rw-r--r--nick.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/nick.c b/nick.c
index f1d2c38..17335d0 100644
--- a/nick.c
+++ b/nick.c
@@ -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) {
diff --git a/nick.h b/nick.h
index 8cac6d8..26613eb 100644
--- a/nick.h
+++ b/nick.h
@@ -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();