Skip to content

Commit 1506a2a

Browse files
authored
Merge pull request #57 from mtalhakrc/main
logic mistake in while condition
2 parents b4ba698 + a0a3172 commit 1506a2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter_3/exercise_3_05/itob.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void itob(int n, char s[], int b)
3939
{
4040
s[i++] = itoc(abs(n) % b);
4141
n /= b;
42-
} while (n /= b);
42+
} while (n);
4343

4444
switch (b)
4545
{

0 commit comments

Comments
 (0)