A tiling window manager

main: use ordinary char type for send_command() arg, not unsigned

probably the intention here was to support characters with values > 127
(ie iso_8859_1 chars), but there's no reason to use unsigned for this:
in C the string functions work just fine as their default type (char)
and don't require casting to support high-ascii characters.

of course, it still won't work with chars > 255, as before.

this change was tested with "sdorfehs -c $'echo \uab'" which correctly
shows the double-arrow, "left-pointing double angle quotation mark"

authored by

Scott Mcdermott and committed by jcs.org 0c6f4363 cf6164df

+4 -4
+2 -2
communications.c
··· 83 83 } 84 84 85 85 int 86 - send_command(int interactive, unsigned char *cmd) 86 + send_command(int interactive, char *cmd) 87 87 { 88 88 struct sockaddr_un sun; 89 89 char *wcmd, *bufstart; ··· 101 101 #endif 102 102 WARNX_DEBUG("%s: enter\n", dpfx); 103 103 104 - len = 1 + strlen((char *)cmd) + 2; 104 + len = 1 + strlen(cmd) + 2; 105 105 wcmd = malloc(len); 106 106 if (snprintf(wcmd, len, "%c%s\n", interactive, cmd) != (len - 1)) 107 107 errx(1, "snprintf");
+1 -1
communications.h
··· 22 22 23 23 void init_control_socket_path(void); 24 24 void listen_for_commands(void); 25 - int send_command(int interactive, unsigned char *cmd); 25 + int send_command(int interactive, char *cmd); 26 26 void receive_command(void); 27 27 28 28 #endif /* ! _SDORFEHS_COMMUNICATIONS_H */
+1 -1
sdorfehs.c
··· 303 303 int j, exit_status = 0; 304 304 305 305 for (j = 0; j < cmd_count; j++) { 306 - if (!send_command(interactive, (unsigned char *)cmd[j])) 306 + if (!send_command(interactive, cmd[j])) 307 307 exit_status = 1; 308 308 free(cmd[j]); 309 309 }