Don't die on empty strings.

pull/1/head
Nicholas Marriott 2008-06-14 08:11:17 +00:00
parent ea80307acb
commit 0bfd7a5023
2 changed files with 18 additions and 14 deletions

View File

@ -1,3 +1,7 @@
14 June 2008
* Don't die on empty strings in config file, reported by Will Maier.
08 June 2008
* Set socket mode +x if any sessions are attached and -x if not.
@ -460,4 +464,4 @@
(including mutt, emacs). No status bar yet and no key remapping or other
customisation.
$Id: CHANGES,v 1.117 2008-06-08 19:49:04 nicm Exp $
$Id: CHANGES,v 1.118 2008-06-14 08:11:16 nicm Exp $

6
cfg.c
View File

@ -1,4 +1,4 @@
/* $Id: cfg.c,v 1.6 2008-06-02 22:16:27 nicm Exp $ */
/* $Id: cfg.c,v 1.7 2008-06-14 08:11:17 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@ -175,7 +175,7 @@ cfg_string(FILE *f, char endch, int esc)
char *buf;
size_t len;
buf = NULL;
buf = xmalloc(1);
len = 0;
while ((ch = getc(f)) != endch) {
@ -211,6 +211,6 @@ cfg_string(FILE *f, char endch, int esc)
buf[len++] = ch;
}
buf[len] = '\0';
buf[len] = '\0';
return (buf);
}