Skip to content

Commit

Permalink
Coverity: Fix fox CID-1550411 (#11868)
Browse files Browse the repository at this point in the history
  • Loading branch information
brbzull0 authored Nov 26, 2024
1 parent aa4e77c commit 29c3e31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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

0 comments on commit 29c3e31

Please sign in to comment.