Skip to content

Commit e9261d6

Browse files
committed
pp_pack.c: Convert variable to bool
The reason for it to be more than this was removed in the previous commit
1 parent b0c3c5f commit e9261d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pp_pack.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ S_utf8_to_bytes(pTHX_ const char **s, const char *end, const char *buf, SSize_t
281281
UV val;
282282
STRLEN retlen;
283283
const char *from = *s;
284-
int bad = 0;
284+
bool bad = false;
285285
const U32 flags = ckWARN(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY;
286286
const bool needs_swap = NEEDS_SWAP(datumtype);
287287

@@ -297,7 +297,7 @@ S_utf8_to_bytes(pTHX_ const char **s, const char *end, const char *buf, SSize_t
297297
NULL, &this_msgs))
298298
{
299299
if (val >= 0x100) {
300-
bad |= 2;
300+
bad = true;
301301
val = (U8) val;
302302
}
303303
}
@@ -343,12 +343,13 @@ S_utf8_to_bytes(pTHX_ const char **s, const char *end, const char *buf, SSize_t
343343
Safefree(msgs);
344344
}
345345

346-
if ((bad & 2))
346+
if (bad) {
347347
ck_warner(packWARN(datumtype & TYPE_IS_PACK ?
348348
WARN_PACK : WARN_UNPACK),
349349
"Character(s) in '%c' format wrapped in %s",
350350
(int) TYPE_NO_MODIFIERS(datumtype),
351351
datumtype & TYPE_IS_PACK ? "pack" : "unpack");
352+
}
352353

353354
*s = from;
354355
return TRUE;

0 commit comments

Comments
 (0)