mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 22:24:56 +00:00
git_config_set_int: use the right buffer
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
e21881d1db
commit
8ecc5ae5cb
@ -222,12 +222,11 @@ int git_config_set_int(git_config *cfg, const char *name, int value)
|
|||||||
buf_len = ret + 1;
|
buf_len = ret + 1;
|
||||||
help_buf = git__malloc(buf_len);
|
help_buf = git__malloc(buf_len);
|
||||||
snprintf(help_buf, buf_len, "%d", value);
|
snprintf(help_buf, buf_len, "%d", value);
|
||||||
}
|
ret = config_set(cfg, name, help_buf);
|
||||||
|
|
||||||
ret = config_set(cfg, name, str_value);
|
|
||||||
|
|
||||||
if (help_buf != NULL)
|
|
||||||
free(help_buf);
|
free(help_buf);
|
||||||
|
} else {
|
||||||
|
ret = config_set(cfg, name, str_value);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user