Skip to content

Commit

Permalink
Revert "Avoid array pointer decay."
Browse files Browse the repository at this point in the history
This reverts commit 7612aab.
  • Loading branch information
evoskuil committed Feb 14, 2024
1 parent 1f39c6d commit 2d2370c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/async/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ std::string format_local_time(time_t time) NOEXCEPT
char buffer[size];

// Returns number of characters, zero implies failure and undefined buffer.
BC_PUSH_WARNING(NO_ARRAY_TO_POINTER_DECAY)
return is_zero(std::strftime(buffer, size, format, &out)) ? "" : buffer;
BC_POP_WARNING()
}

std::string format_zulu_time(time_t time) NOEXCEPT
Expand All @@ -96,7 +98,9 @@ std::string format_zulu_time(time_t time) NOEXCEPT
char buffer[size];

// Returns number of characters, zero implies failure and undefined buffer.
BC_PUSH_WARNING(NO_ARRAY_TO_POINTER_DECAY)
return is_zero(std::strftime(buffer, size, format, &out)) ? "" : buffer;
BC_POP_WARNING()
}

} // namespace network
Expand Down

0 comments on commit 2d2370c

Please sign in to comment.