Skip to content

Commit f303fc8

Browse files
committed
Use bool in mbfl_filt_conv_output_hex (rather than int)
1 parent 776296e commit f303fc8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ext/mbstring/libmbfl/mbfl/mbfl_convert.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,13 @@ int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char
216216

217217
static int mbfl_filt_conv_output_hex(unsigned int w, mbfl_convert_filter *filter)
218218
{
219-
int nonzero = 0, shift = 28, ret = 0;
219+
bool nonzero = false;
220+
int shift = 28, ret = 0;
220221

221222
while (shift >= 0) {
222223
int n = (w >> shift) & 0xF;
223224
if (n || nonzero) {
224-
nonzero = 1;
225+
nonzero = true;
225226
ret = (*filter->filter_function)(mbfl_hexchar_table[n], filter);
226227
if (ret < 0) {
227228
return ret;
@@ -230,8 +231,8 @@ static int mbfl_filt_conv_output_hex(unsigned int w, mbfl_convert_filter *filter
230231
shift -= 4;
231232
}
232233

233-
if (nonzero == 0) {
234-
/* illegal character was zero; no hex digits were output by above loop */
234+
if (!nonzero) {
235+
/* No hex digits were output by above loop */
235236
ret = (*filter->filter_function)('0', filter);
236237
}
237238

0 commit comments

Comments
 (0)