Skip to content

Commit 536e637

Browse files
yhiroseCopilot
andauthored
Update httplib.h
Co-authored-by: Copilot <[email protected]>
1 parent d934f56 commit 536e637

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

httplib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,11 +3158,11 @@ inline bool FileStat::is_dir() const {
31583158
}
31593159

31603160
inline size_t FileStat::mtime() const {
3161-
return static_cast<size_t>(st_.st_mtime);
3161+
return ret_ >= 0 ? static_cast<size_t>(st_.st_mtime) : 0;
31623162
}
31633163

31643164
inline size_t FileStat::size() const {
3165-
return static_cast<size_t>(st_.st_size);
3165+
return ret_ >= 0 ? static_cast<size_t>(st_.st_size) : 0;
31663166
}
31673167

31683168
inline std::string encode_path(const std::string &s) {

0 commit comments

Comments
 (0)