Skip to content

Commit

Permalink
Fixed minor warnings reported by gcc 11.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Eichelberg committed Feb 21, 2023
1 parent 812c512 commit f7ca841
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion oficonv/libsrc/citrus_hz.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ _citrus_HZ_wcrtomb_priv(_HZEncodingInfo * ei,
ch = (wc >> (len * 8)) & 0xFF;
if (range->start > ch || range->end < ch)
goto ilseq;
psenc->ch[psenc->chlen++] = (char) (ch | bit);
if (psenc->chlen < ROWCOL_MAX) {
psenc->ch[psenc->chlen++] = (char) (ch | bit);
} else {
return (E2BIG);
}
}
memcpy(s, psenc->ch, psenc->chlen);
*nresult = psenc->chlen;
Expand Down
8 changes: 6 additions & 2 deletions oficonv/libsrc/citrus_jisx0208.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,12 @@ _citrus_JISX0208_mbrtowc_priv(_JISX0208EncodingInfo *ei, _citrus_wc_t *pwc, char
while (psenc->chlen < c) {
if (n < 1)
goto restart;
psenc->ch[psenc->chlen] = *s0++;
psenc->chlen++;
if (psenc->chlen < 3) {
psenc->ch[psenc->chlen] = *s0++;
psenc->chlen++;
} else {
return (E2BIG);
}
n--;
}
*s = s0;
Expand Down

0 comments on commit f7ca841

Please sign in to comment.