Skip to content

Commit 29c21ce

Browse files
committed
Remove the feature of fill the rest of the buffer with \0 in reiconv_convert_static_size.
1 parent 477ca17 commit 29c21ce

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

benchmark/reiconv_iconv.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ void* reiconv_iconv_open()
1010
{
1111
return reiconv_open_from_index(ENCODING_UTF8, ENCODING_GB18030, REICONV_NO_FLAGS);
1212
}
13-

include/cppp/reiconv.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ extern _CPPP_API size_t reiconv_result_size(reiconv_t cd, const char *start, siz
162162
* @note The function `reiconv_convert` is more easy to use. This function is for performance and flexibility.
163163
* @note This function does not treat zero characters specially.
164164
* @param cd The input conversion descriptor.
165-
* @param input_data the input buffer.
165+
* @param input_data The input buffer.
166166
* @param input_length Input buffer length.
167167
* @param output_data The output buffer pointer.
168-
* @param output_length the output buffer's length.
168+
* @param output_length The output buffer's length.
169169
* @note If the output buffer is too small, -1 is returned.
170-
* @note If the output buffer is too big, the rest of the buffer is filled with zero.
170+
* @note If the output buffer is too big, the rest of the buffer will not change.
171171
* @return 0 on success, -1 on error with errno set.
172172
*/
173173
extern _CPPP_API int reiconv_convert_static_size(reiconv_t cd, const char *input_data, size_t input_length,

lib/iconv.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ _CPPP_API int reiconv_convert_static_size(reiconv_t cd, const char *input_data,
262262
{
263263
return -1;
264264
}
265-
memset(outptr, 0, outsize); // Fill the rest of the buffer with '\0'.
266265
return 0;
267266
}
268267

0 commit comments

Comments
 (0)