comparison src/tables.c @ 15:f671821d8222

code beautifying; 0 -> \0 if appropriate
author meillo@marmaro.de
date Thu, 06 Nov 2008 09:18:38 +0100
parents 26e34ae9a3e3
children 6c59dedd06be
comparison
equal deleted inserted replaced
14:a8f3424347dc 15:f671821d8222
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software 15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */ 17 */
18 18
19 #include <fnmatch.h>
20
19 #include "masqmail.h" 21 #include "masqmail.h"
20 #include <fnmatch.h>
21 22
22 table_pair* 23 table_pair*
23 create_pair(gchar * key, gpointer value) 24 create_pair(gchar * key, gpointer value)
24 { 25 {
25 table_pair *pair; 26 table_pair *pair;
50 gchar *p, *q; 51 gchar *p, *q;
51 table_pair *pair; 52 table_pair *pair;
52 53
53 p = line; 54 p = line;
54 q = buf; 55 q = buf;
55 while ((*p != 0) && (*p != delim) && q < buf + 255) 56 while ((*p != '\0') && (*p != delim) && q < buf + 255)
56 *(q++) = *(p++); 57 *(q++) = *(p++);
57 *q = 0; 58 *q = '\0';
58 59
59 pair = g_malloc(sizeof(table_pair)); 60 pair = g_malloc(sizeof(table_pair));
60 pair->key = g_strdup(g_strstrip(buf)); 61 pair->key = g_strdup(g_strstrip(buf));
61 62
62 if (*p) { 63 if (*p) {