diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 5c78f1ec86..b2daf68935 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -1977,7 +1977,8 @@ static int scan_background_color_response( size_t *ret_processed) { assert(context); - assert(buf || size == 0); + assert(buf); + assert(ret_processed); for (size_t i = 0; i < size; i++) { char c = buf[i]; @@ -2051,9 +2052,7 @@ static int scan_background_color_response( case BACKGROUND_BLUE: if (c == '\x07') { if (context->blue_bits > 0) { - if (ret_processed) - *ret_processed = i + 1; - + *ret_processed = i + 1; return 1; /* success! */ } @@ -2073,9 +2072,7 @@ static int scan_background_color_response( case BACKGROUND_STRING_TERMINATOR: if (c == '\\') { - if (ret_processed) - *ret_processed = i + 1; - + *ret_processed = i + 1; return 1; /* success! */ } @@ -2092,9 +2089,7 @@ static int scan_background_color_response( } } - if (ret_processed) - *ret_processed = size; - + *ret_processed = size; return 0; /* all good, but not enough data yet */ } @@ -2221,7 +2216,8 @@ static int scan_cursor_position_response( size_t *ret_processed) { assert(context); - assert(buf || size == 0); + assert(buf); + assert(ret_processed); for (size_t i = 0; i < size; i++) { char c = buf[i]; @@ -2254,9 +2250,7 @@ static int scan_cursor_position_response( case CURSOR_COLUMN: if (c == 'R') { if (context->column > 0) { - if (ret_processed) - *ret_processed = i + 1; - + *ret_processed = i + 1; return 1; /* success! */ } @@ -2279,9 +2273,7 @@ static int scan_cursor_position_response( context->row = context->column = 0; } - if (ret_processed) - *ret_processed = size; - + *ret_processed = size; return 0; /* all good, but not enough data yet */ } diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index 0f27b3df54..376d1fe301 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -165,7 +165,7 @@ int pty_open_peer(int fd, int mode); static inline bool osc_char_is_valid(char c) { /* Checks whether the specified character is safe to be included inside an ANSI OSC sequence, as per * ECMA-48 5th edition, section 8.3.89 */ - return (unsigned char) c >= 32U && (unsigned char) c < 127; + return (unsigned char) c >= 32 && (unsigned char) c < 127; } static inline bool vtnr_is_valid(unsigned n) { diff --git a/src/boot/efi-string.c b/src/boot/efi-string.c index 4b9c3181c0..59cb0fa9f5 100644 --- a/src/boot/efi-string.c +++ b/src/boot/efi-string.c @@ -755,7 +755,7 @@ static bool handle_format_specifier(FormatContext *ctx, SpecifierContext *sp) { * otherwise warn about fetching smaller types. */ assert_cc(sizeof(int) == 4); assert_cc(sizeof(wchar_t) <= sizeof(int)); - assert_cc(sizeof(intmax_t) <= sizeof(long long)); + assert_cc(sizeof(long long) == sizeof(intmax_t)); assert(ctx); assert(sp);