6 #include "../../include/utils/colors.h"
33 char *formatted = malloc(
sizeof(message) +
sizeof(pcolor));
34 if (formatted == NULL) {
35 printf(
"failed to format colored string\n");
38 strcat(formatted, pcolor);
39 strcat(formatted, message);
51 char *write_message = calloc(
sizeof(
char), strlen(pcolor) + strlen(reset) + strlen(message) + 2);
52 if (write_message == NULL) {
53 printf(
"failed to calloc write_message\n");
56 strcat(write_message, pcolor);
57 strcat(write_message, message);
58 strcat(write_message, reset);
59 strcat(write_message,
"\n");
60 int response = write(file_descriptor, write_message, strlen(write_message));
63 printf(
"failed to write colored message\n");