check if first charactor is \0, its faster than strlen
This commit is contained in:
parent
d3e9803cf2
commit
96a074bb4d
1 changed files with 1 additions and 1 deletions
2
fbflut.c
2
fbflut.c
|
@ -42,7 +42,7 @@ void *handle_connection(void *socket_desc) {
|
|||
strncpy(colorcode, safestrtok(NULL, " \n"), 8);
|
||||
|
||||
if (xpos >= 0 && ypos >= 0 && xpos < fb_width && ypos < fb_height) {
|
||||
if (strlen(colorcode) == 0) {
|
||||
if (colorcode[0] == '\0') {
|
||||
message = calloc(sizeof(char), 36);
|
||||
asprintf(&message, "PX %i %i %X\n",xpos,ypos,fbdata[ypos*fb_length+xpos]);
|
||||
write(sock, message, strlen(message));
|
||||
|
|
Loading…
Reference in a new issue