Satisfy compiler warning about unchecked getcwd() return
TODO: raise an error
This commit is contained in:
parent
3ad4f9f199
commit
ca3ab55a5c
|
@ -28,7 +28,12 @@ void path_to_dirname(char *path)
|
|||
*p = '\0';
|
||||
}
|
||||
|
||||
void get_cwd(char *buf, size_t size) { getcwd(buf, size); }
|
||||
void get_cwd(char *buf, size_t size)
|
||||
{
|
||||
if (!getcwd(buf, size)) {
|
||||
memset(buf, 0, size);
|
||||
}
|
||||
}
|
||||
|
||||
int set_cwd(char *buf)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue