mirror of
https://github.com/atom/atom.git
synced 2026-01-15 01:48:15 -05:00
Add parens around string length
This commit is contained in:
@@ -106,7 +106,7 @@ namespace v8_extensions {
|
||||
return;
|
||||
|
||||
int shortNameLength = branchNameLength - 11;
|
||||
char* shortName = (char*) malloc(sizeof(char) * shortNameLength + 1);
|
||||
char* shortName = (char*) malloc(sizeof(char) * (shortNameLength + 1));
|
||||
shortName[shortNameLength] = '\0';
|
||||
strncpy(shortName, &branchName[11], shortNameLength);
|
||||
*out = shortName;
|
||||
@@ -122,9 +122,9 @@ namespace v8_extensions {
|
||||
return;
|
||||
|
||||
int shortBranchNameLength = strlen(shortBranchName);
|
||||
char* remoteKey = (char*) malloc(sizeof(char) * shortBranchNameLength + 15);
|
||||
char* remoteKey = (char*) malloc(sizeof(char) * (shortBranchNameLength + 15));
|
||||
sprintf(remoteKey, "branch.%s.remote", shortBranchName);
|
||||
char* mergeKey = (char*) malloc(sizeof(char) * shortBranchNameLength + 14);
|
||||
char* mergeKey = (char*) malloc(sizeof(char) * (shortBranchNameLength + 14));
|
||||
sprintf(mergeKey, "branch.%s.merge", shortBranchName);
|
||||
free((char*)shortBranchName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user