ptites optis

master
Tristan MARTINEK 3 years ago
parent b3ca9337a2
commit 1cc9e3d191

@ -3,7 +3,7 @@
long decode(char *nbr, char *base_from)
{
int i;
int i;
long result;
i = 0;
@ -24,7 +24,7 @@ long decode(char *nbr, char *base_from)
void convert(long medium, char *base_to,
char *unestring, int *p_i)
{
long l_base;
long l_base;
l_base = check(base_to);
if (medium >= 0 && medium < l_base)
@ -42,7 +42,7 @@ void convert(long medium, char *base_to,
char *jonemar(char *cepafini, char *celafin, int i)
{
int j;
int j;
j = 0;
while (cepafini[j])
@ -59,16 +59,14 @@ char *recode(long medium, char *base_to, int posi)
{
char cepafini[50];
char *celafin;
int i;
int *p_i;
int i;
i = 0;
p_i = &i;
convert(medium, base_to, cepafini, p_i);
convert(medium, base_to, cepafini, &i);
if (posi < 0)
celafin = (char *)malloc(sizeof(char) * (*p_i + 3));
celafin = (char *)malloc(sizeof(char) * (i + 3));
else
celafin = (char *)malloc(sizeof(char) * (*p_i + 2));
celafin = (char *)malloc(sizeof(char) * (i + 2));
if (!(celafin))
return (0);
if (posi < 0 && medium != 0)

@ -1,13 +1,13 @@
int check(char *base)
{
int i;
int j;
int i;
int j;
i = 0;
while (base[i] != '\0')
while (base[i])
{
j = i + 1;
while (base[j] != '\0')
while (base[j])
{
if (base[j] == base[i])
return (0);
@ -24,7 +24,7 @@ int check(char *base)
int is_base(char k, char *base)
{
int i;
int i;
i = 0;
while (base[i])
@ -38,7 +38,7 @@ int is_base(char k, char *base)
int unchar(char k, char *base)
{
int i;
int i;
i = 0;
while (base[i])
@ -52,8 +52,8 @@ int unchar(char k, char *base)
int start(char *str)
{
int posi;
int i;
int posi;
int i;
i = 0;
posi = 1;

Loading…
Cancel
Save