Apply code review feedback

This commit is contained in:
Nelson Elhage
2018-10-11 13:27:06 +00:00
parent 416aafd14c
commit 463c21e2c1
2 changed files with 5 additions and 8 deletions

View File

@@ -43,20 +43,17 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
git_config_backend *backend = NULL;
int err = 0;
err = git_config_new(&cfg);
if (err != 0) {
if ((err = git_config_new(&cfg)) != 0) {
goto out;
}
err = git_config_backend_from_string(&backend, (const char*)data, size);
if (err != 0) {
if ((err = git_config_backend_from_string(&backend, (const char*)data, size)) != 0) {
goto out;
}
err = git_config_add_backend(cfg, backend, 0, NULL, 0);
if (err != 0) {
if ((err = git_config_add_backend(cfg, backend, 0, NULL, 0)) != 0) {
goto out;
}
// Now owned by the config
/* Now owned by the config */
backend = NULL;
git_config_foreach(cfg, foreach_cb, NULL);

View File

@@ -198,7 +198,7 @@ int git_config_backend_from_string(git_config_backend **out, const char *cfg, si
return -1;
}
if (git_buf_put(&backend->cfg, cfg, len) < 0) {
if (git_buf_set(&backend->cfg, cfg, len) < 0) {
git_config_entries_free(backend->entries);
git__free(backend);
return -1;