Skip to content

Commit

Permalink
ast.h: mb2wc() macro: add safety parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Mar 9, 2024
1 parent 5b5bfae commit a01ce5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/libast/include/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ typedef struct
#define mbcoll() ( ast.mb_xfrm != 0 )
#define mbwide() ( mbmax() > 1 )

#define mb2wc(w,p,n) ( (*ast.mb_towc)(&w, (char*)p, n) )
#define mb2wc(w,p,n) ( (*ast.mb_towc)(&w, (char*)(p), n) )
#define mbchar(p) mbnchar(p, mbmax())
#define mbnchar(p,n) ( mbwide() ? ( (ast.tmp_int = (*ast.mb_towc)(&ast.tmp_wchar, (char*)(p), n)) > 0 ? \
( (p+=ast.tmp_int),ast.tmp_wchar) : (p+=ast.mb_sync+1,ast.tmp_int) ) : (*(unsigned char*)(p++)) )
Expand Down

0 comments on commit a01ce5c

Please sign in to comment.