Skip to content

Commit 1dfe2cf

Browse files
committed
Ensure unsigned char for gcc and improve implementation
1 parent aa7daab commit 1dfe2cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ create_horizontal_line(char * result, CONSOLE_SCREEN_BUFFER_INFO csbi)
5858
{
5959
SHORT i;
6060
SHORT console_width = csbi.srWindow.Right + 1;
61-
const char horizontal_line_character = (char)196;
61+
const char horizontal_line_character[] = { (char)196, '\0' };
6262

6363
/* Draw line in result string */
6464
for(i = 0; i < console_width; ++i) {
6565
//if (i == console_width / 2) {
6666
// strcat(string, "%c", );
6767
//} else {
68-
strncat(result, &horizontal_line_character, 1);
68+
strncat(result, horizontal_line_character, 2);
6969
//}
7070
}
7171

makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CL = cl.exe -nologo -J -WX -W4 -sdl -arch:IA32 -O2 -D_CRT_SECURE_NO_WARNINGS
22
LINK = link.exe -nologo -subsystem:console,"5.01"
33

44
GCC = gcc
5-
CFLAGS = -std=c99 -O2 -fdiagnostics-color -mconsole -Wall -Wextra -pedantic-errors -Wfatal-errors -Wshadow -Wconversion -Wsign-conversion -Wno-missing-braces
5+
CFLAGS = -std=c99 -funsigned-char -O2 -fdiagnostics-color -Wall -Wextra -pedantic-errors -Wfatal-errors -Wshadow -Wconversion -Wsign-conversion -Wno-missing-braces
66
LDFLAGS = -mconsole
77

88

0 commit comments

Comments
 (0)