c_piscine__offshore_mains/common/tests.c
2023-11-23 23:06:22 +04:00

30 lines
388 B
C

#include "tests.h"
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);
}