Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity: Fix fox CID-1550411 #11868

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions include/tscore/ink_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "tscore/ink_platform.h"

#include <cstdio>
#include <cstdint>
#include <sys/types.h>
#include <dirent.h>
#include <stdint.h>
Expand Down Expand Up @@ -84,10 +85,10 @@ inline constexpr mode_t DEFAULT_OPEN_MODE{0644};

int safe_open(char const *path, int oflag = O_RDWR | O_NDELAY | O_CREAT, mode_t mode = DEFAULT_OPEN_MODE);

int ink_fputln(FILE *stream, const char *s);
int ink_file_fd_readline(int fd, int bufsize, char *buf);
int ink_file_fd_writestring(int fd, const char *buf);
int ink_filepath_merge(char *buf, int bufsz, const char *rootpath, const char *addpath, int flags = INK_FILEPATH_TRUENAME);
std::int64_t ink_fputln(FILE *stream, const char *s);
int ink_file_fd_readline(int fd, int bufsize, char *buf);
int ink_file_fd_writestring(int fd, const char *buf);
int ink_filepath_merge(char *buf, int bufsz, const char *rootpath, const char *addpath, int flags = INK_FILEPATH_TRUENAME);
/**
Add addpath to the rootpath prepending slash if rootpath
is not nullptr and doesn't end with the slash already and put the
Expand Down
2 changes: 1 addition & 1 deletion src/tscore/ink_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ safe_open(char const *path, int oflag, mode_t mode)
return r;
}

int
std::int64_t
ink_fputln(FILE *stream, const char *s)
{
if (stream && s) {
Expand Down