pad color output with zeros to be at least 6 letters long

This commit is contained in:
xfnw 2021-12-03 08:59:54 -05:00
parent 0df4eebd91
commit 548abe4349

View file

@ -63,7 +63,7 @@ void *handle_connection(void *socket_desc) {
if (xpos >= 0 && ypos >= 0 && xpos < fb_width && ypos < fb_height) {
if (colorcode[0] == '\0') {
sprintf(message, "PX %i %i %X\n",xpos,ypos,fbdata[ypos*fb_length+xpos]);
sprintf(message, "PX %i %i %06X\n",xpos,ypos,fbdata[ypos*fb_length+xpos]);
write(sock, message, strlen(message));
continue;
} else {