Merge branch 'bg/xcalloc-nmemb-then-size'
Like calloc(3), xcalloc() takes nmemb and then size. * bg/xcalloc-nmemb-then-size: transport-helper.c: rearrange xcalloc arguments remote.c: rearrange xcalloc arguments reflog-walk.c: rearrange xcalloc arguments pack-revindex.c: rearrange xcalloc arguments notes.c: rearrange xcalloc arguments imap-send.c: rearrange xcalloc arguments http-push.c: rearrange xcalloc arguments diff.c: rearrange xcalloc arguments config.c: rearrange xcalloc arguments commit.c: rearrange xcalloc arguments builtin/remote.c: rearrange xcalloc arguments builtin/ls-remote.c: rearrange xcalloc arguments
This commit is contained in:
4
config.c
4
config.c
@ -1539,7 +1539,7 @@ int git_config_set_multivar_in_file(const char *config_filename,
|
||||
* The lock serves a purpose in addition to locking: the new
|
||||
* contents of .git/config will be written into it.
|
||||
*/
|
||||
lock = xcalloc(sizeof(struct lock_file), 1);
|
||||
lock = xcalloc(1, sizeof(struct lock_file));
|
||||
fd = hold_lock_file_for_update(lock, config_filename, 0);
|
||||
if (fd < 0) {
|
||||
error("could not lock config file %s: %s", config_filename, strerror(errno));
|
||||
@ -1802,7 +1802,7 @@ int git_config_rename_section_in_file(const char *config_filename,
|
||||
if (!config_filename)
|
||||
config_filename = filename_buf = git_pathdup("config");
|
||||
|
||||
lock = xcalloc(sizeof(struct lock_file), 1);
|
||||
lock = xcalloc(1, sizeof(struct lock_file));
|
||||
out_fd = hold_lock_file_for_update(lock, config_filename, 0);
|
||||
if (out_fd < 0) {
|
||||
ret = error("could not lock config file %s", config_filename);
|
||||
|
Reference in New Issue
Block a user