diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-24 09:33:51 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-08-24 09:33:51 +0200 |
| commit | d02bd0eb656b885bdf48088529183c40df8bd9c1 (patch) | |
| tree | 799a8b5ff0c55978235d7c8bf69e2940d427c5f3 /dev/lib/utility | |
| parent | 3c50f5e98f28be7a9909c02172da6e627fd2b665 (diff) | |
feat: lib: micro-optimizations and improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/lib/utility')
| -rw-r--r-- | dev/lib/utility/cgi_writer.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/dev/lib/utility/cgi_writer.hpp b/dev/lib/utility/cgi_writer.hpp index 2c30adf..69d0170 100644 --- a/dev/lib/utility/cgi_writer.hpp +++ b/dev/lib/utility/cgi_writer.hpp @@ -4,8 +4,8 @@ * Copyright 2023-2025, Amlal El Mahrouss. */ -#ifndef _SNU_CGI_HPP -#define _SNU_CGI_HPP +#ifndef _SNU_CGI_WRITER_HPP +#define _SNU_CGI_WRITER_HPP #include <cstdio> #include <string> @@ -25,7 +25,13 @@ namespace snu std::printf("Content-Type: %s\r\n", mime.c_str()); std::printf("Server: %s\r\n", "socl-cgi-system"); std::printf("Content-Length: %ld\r\n\r\n", ss.str().size()); - std::printf("%s", ss.str().c_str()); + + auto ss_cc = ss.str(); + + for (auto& ch : ss_cc) + { + std::printf("%c", ch); + } return *this; } @@ -66,4 +72,4 @@ namespace snu } // namespace cgi } // namespace snu -#endif // ifndef _SNU_CGI_HPP
\ No newline at end of file +#endif // ifndef _SNU_CGI_WRITER_HPP |
