We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b721ce commit ad2abf0Copy full SHA for ad2abf0
print_digits.c
@@ -19,6 +19,11 @@ int print_decimal(va_list ap)
19
int num = va_arg(ap, int);
20
char *number_string;
21
22
+ if (!num)
23
+ {
24
+ write(2, "Error", 6);
25
+ return (-1);
26
+ }
27
if (num < 0)
28
{
29
write(1, "-", 1);
print_helpers.c
@@ -74,6 +74,11 @@ int str_write(char *number_string)
74
size_t i, len, byte_size;
75
int count = 0;
76
77
+ if (number_string == NULL)
78
79
80
81
82
len = strlen(number_string);
83
byte_size = ((len - 1) / MAX_BYTE_SIZE) + 1;
84
0 commit comments