)]}'
{"src/helper/log.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"eadfcd7d942d400128bd3368fec8a49d2b0c8d06","unresolved":false,"context_lines":[{"line_number":526,"context_line":"char *find_nonprint_char(char *buf, unsigned buf_len)"},{"line_number":527,"context_line":"{"},{"line_number":528,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c buf_len; i++) {"},{"line_number":529,"context_line":"\t\tif (!isprint((int)buf[i]))"},{"line_number":530,"context_line":"\t\t\treturn buf + i;"},{"line_number":531,"context_line":"\t}"},{"line_number":532,"context_line":"\treturn NULL;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"2ecb373e_11808c4a","line":529,"updated":"2021-08-20 16:13:25.000000000","message":"I\u0027ve seen the email on the list from Martin Husemann and your comments in IRC.\nI think it\u0027s enough to use\n   if (!isprint((unsigned char)buf[i]))\nIf isprint() is a macro with look-up table, it\u0027s ok.\nIf isprint() is a function that requires \u0027int\u0027 value, C will automatically promote the \u0027unsigned char\u0027 to \u0027int\u0027.","commit_id":"d45a92e399e98fe4709730c218223ceddcdaa454"},{"author":{"_account_id":1000005,"name":"Andreas Fritiofson","email":"andreas.fritiofson@gmail.com","username":"Nattgris"},"change_message_id":"5048ef93c6a309eecbf9e175ca9415f699e7fb8f","unresolved":false,"context_lines":[{"line_number":526,"context_line":"char *find_nonprint_char(char *buf, unsigned buf_len)"},{"line_number":527,"context_line":"{"},{"line_number":528,"context_line":"\tfor (unsigned int i \u003d 0; i \u003c buf_len; i++) {"},{"line_number":529,"context_line":"\t\tif (!isprint((int)buf[i]))"},{"line_number":530,"context_line":"\t\t\treturn buf + i;"},{"line_number":531,"context_line":"\t}"},{"line_number":532,"context_line":"\treturn NULL;"}],"source_content_type":"text/x-csrc","patch_set":2,"id":"2ecb373e_d199a4c9","line":529,"in_reply_to":"2ecb373e_11808c4a","updated":"2021-08-20 16:32:36.000000000","message":"Yes, the correct form is isprint((unsigned char)c) if c is of type plain char. These functions only take arguments in the range of an unsigned char or EOF. Converting directly to int, explicitly as here or implicitly, will produce the wrong value and undefined behaviour if plain char is signed and c is negative.","commit_id":"d45a92e399e98fe4709730c218223ceddcdaa454"}]}
