mirror of
https://github.com/fluencelabs/redis
synced 2025-05-31 11:11:20 +00:00
check return value of getcwd()
This commit is contained in:
parent
1a6281f52f
commit
eb5aeaf138
@ -471,10 +471,12 @@ void configGetCommand(redisClient *c) {
|
||||
if (stringmatch(pattern,"dir",0)) {
|
||||
char buf[1024];
|
||||
|
||||
buf[0] = '\0';
|
||||
getcwd(buf,sizeof(buf));
|
||||
addReplyBulkCString(c,"dir");
|
||||
addReplyBulkCString(c,buf);
|
||||
if (getcwd(buf,sizeof(buf)) == NULL) {
|
||||
buf[0] = '\0';
|
||||
} else {
|
||||
addReplyBulkCString(c,buf);
|
||||
}
|
||||
matches++;
|
||||
}
|
||||
if (stringmatch(pattern,"dbfilename",0)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user