c_piscine__offshore_mains/common/tests.c

30 lines
388 B
C
Raw Permalink Normal View History

2023-11-23 19:06:22 +00:00
#include "tests.h"
2023-11-23 18:26:57 +00:00
void dump(char *data, int len)
{
int i = 0;
while (i < len)
{
if (data[i] >= ' ' && data[i] < 127)
printf(" %c ", data[i]);
else
printf(FG_MAG "\\%02u" COLOR_RESET, data[i]);
i++;
}
printf("\n");
}
int bufcmp(char *this, char *other, int len)
{
int i = 0;
while (i < len)
{
if (this[i] != other[i])
return (i + 1);
i++;
}
return (0);
}