diff options
author | Aaron Ball <nullspoon@oper.io> | 2024-10-26 21:47:49 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2024-10-26 21:47:49 -0600 |
commit | f63fc89d66695d27c5382b7a8b93e279854afc3b (patch) | |
tree | e01e71edb45e93685bc262356a21dc4b8c462dcb | |
parent | e20fb9d85d0203dbdd7049abd38bcfc3f392e91b (diff) | |
download | motd.sh-f63fc89d66695d27c5382b7a8b93e279854afc3b.tar.gz motd.sh-f63fc89d66695d27c5382b7a8b93e279854afc3b.tar.xz |
main:Fix return code handling for access checks
-rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -31,17 +31,17 @@ int main() { cgi_print_header("text/html", 200); - if(header != NULL && access(header, R_OK)) + if(header != NULL && access(header, R_OK) == 0) catfile(header, stdout); // Print query string file if specified, otherwise default - if(body != NULL && access(body, R_OK)) + if(body != NULL && access(body, R_OK) == 0) catfile(body, stdout); - else if(defaultpage != NULL && access(defaultpage, R_OK)) + else if(defaultpage != NULL && access(defaultpage, R_OK) == 0) catfile(defaultpage, stdout); - if(footer != NULL && access(footer, R_OK)) + if(footer != NULL && access(footer, R_OK) == 0) catfile(footer, stdout); return 0; } |