Skip to content

Commit

Permalink
Fix incorrect argument type in sscanf
Browse files Browse the repository at this point in the history
    clang -Os -DNDEBUG -std=c11 -DVERSION='"0.2.0-4-g073eced"' -o build/tty-copy.o -c tty-copy.c
    tty-copy.c:256:13: warning: passing 'uchar [16]' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
            if (sscanf(buf, "\033[%d;%dR", &row, &col) != 2) {
                       ^~~
    /usr/include/stdio.h:412:60: note: passing argument to parameter '__s' here
    extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s,
                                                               ^
    1 warning generated.

Fixes #3
  • Loading branch information
jirutka committed Mar 17, 2022
1 parent 27f3492 commit cf18dc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tty-copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int fpeek (FILE *stream) {
* Returns the cursor position on the X-axis (column), or -1 on error.
*/
static int get_cursor_column (FILE *tty) {
uchar buf[16] = {'\0'};
char buf[16] = {'\0'};

if (fputs("\033[6n", tty) < 0) {
return -1;
Expand Down

0 comments on commit cf18dc8

Please sign in to comment.