aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-06-29 01:35:48 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-06-29 01:35:48 +0300
commitd78bfa616320cba4943c9cf0f28f3bb4ed335fa0 (patch)
treeeac1e900f4349bc76030771e82c5dc8a9beb71b4
parent2af5a2255dfcf46c06cb39010768863c5a2837aa (diff)
downloadsmap-d78bfa616320cba4943c9cf0f28f3bb4ed335fa0.tar.gz
smap-d78bfa616320cba4943c9cf0f28f3bb4ed335fa0.tar.bz2
Bugfix.
-rw-r--r--src/cfg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cfg.c b/src/cfg.c
index e0eea62..4af6829 100644
--- a/src/cfg.c
+++ b/src/cfg.c
@@ -235,25 +235,25 @@ asgn(struct wordsplit *ws, size_t *psize)
235 ws->ws_env = ecalloc(size, sizeof(ws->ws_env[0])); 235 ws->ws_env = ecalloc(size, sizeof(ws->ws_env[0]));
236 ws->ws_env[0] = ws->ws_wordv[0]; 236 ws->ws_env[0] = ws->ws_wordv[0];
237 } else { 237 } else {
238 size_t n = find_env_var(ws->ws_env, ws->ws_wordv[0]); 238 size_t n = find_env_var(ws->ws_env, ws->ws_wordv[0]);
239 if (ws->ws_env[n]) 239 if (ws->ws_env[n])
240 free((char*)ws->ws_env[n]); 240 free((char*)ws->ws_env[n]);
241 else if (n == size - 1) { 241 else if (n == size - 1) {
242 size *= 2; 242 size *= 2;
243 ws->ws_env = erealloc(ws->ws_env, 243 ws->ws_env = erealloc(ws->ws_env,
244 size * sizeof(ws->ws_env[0])); 244 size * sizeof(ws->ws_env[0]));
245 } 245 }
246 ws->ws_env[n] = ws->ws_wordv[0]; 246 ws->ws_env[n] = ws->ws_wordv[0];
247 ws->ws_env[n++] = NULL; 247 ws->ws_env[++n] = NULL;
248 } 248 }
249 ws->ws_wordv[0] = NULL; 249 ws->ws_wordv[0] = NULL;
250 *psize = size; 250 *psize = size;
251} 251}
252 252
253 253
254void 254void
255parse_config_loop(struct cfg_kw *kwtab, void *data) 255parse_config_loop(struct cfg_kw *kwtab, void *data)
256{ 256{
257 char *buf = NULL; 257 char *buf = NULL;
258 size_t size = 0; 258 size_t size = 0;
259 struct wordsplit ws; 259 struct wordsplit ws;

Return to:

Send suggestions and report system problems to the System administrator.