Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int _printf(const char *format, ...)
int counter = 0;

if (format != NULL)
{
{
va_start(type, format);
for (counter = 0; format[counter] != '\0'; counter++)
{
Expand All @@ -66,7 +66,7 @@ int _printf(const char *format, ...)
else
{
y += (_putchar(format[counter] + _putchar(format[counter + 1])));
counter++;
counter++;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions _putchar.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <unistd.h>
#include "holberton.h"

/**
* _putchar - writes the character c to stdout
Expand Down
10 changes: 4 additions & 6 deletions func_pr.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include "holberton.h"

/**
Expand Down Expand Up @@ -29,10 +28,9 @@ int p_string(va_list type_pr)
char *str;

str = va_arg(type_pr, char *);
if (str)
{
for (i = 0; str[i]; i++)
counter += _putchar(str[i]);
}
if (str == NULL)
str = "(null)";
for (i = 0; str[i]; i++)
counter += _putchar(str[i]);
return (counter);
}