Skip to content

Commit

Permalink
Merge pull request #2 from josealf/master
Browse files Browse the repository at this point in the history
Fix bug - buf must be null terminated
  • Loading branch information
oboroc committed Aug 13, 2015
2 parents 86df2e1 + 5a1cb04 commit 4a48981
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bdecli.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,10 @@ int bde_cfg_add_entry(bde_entry_t *list, char *szFQNPath, char *szName, char *sz
return 0;
}

if ('\\' == tmp[i])
if ('\\' == tmp[i]) {
strncpy_s(buf, MAX_BUFFER, tmp, i);
buf[i] = 0;
}
else
strcpy_s(buf, MAX_BUFFER, tmp);

Expand Down

0 comments on commit 4a48981

Please sign in to comment.