From e294eaffc1a2c46cd3a01aa09a9c4e5ea8f29108 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 25 Aug 2010 17:56:54 +0000 Subject: [PATCH] Code cleanup --- src/parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parser.c b/src/parser.c index 9bddad2..ba0e4c8 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2008 Pierre Pronchery */ +/* Copyright (c) 2010 Pierre Pronchery */ /* This file is part of DeforaOS System libSystem */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -283,9 +283,10 @@ int parser_get_token(Parser * parser, Token ** token) /* parser_add_callback */ int parser_add_callback(Parser * parser, ParserCallback callback, void * data) { - ParserCallbackData * p = parser->callbacks; + ParserCallbackData * p; - if((p = realloc(p, sizeof(*p) * (parser->callbacks_cnt + 1))) == NULL) + if((p = realloc(parser->callbacks, sizeof(*p) * (parser->callbacks_cnt + + 1))) == NULL) return 1; parser->callbacks = p; p = &parser->callbacks[parser->callbacks_cnt++];