Commit 5a22dbb1 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in digits(), remove the assumption that n is always positive, although

it always is in this particular case


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3842 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 10 additions and 2 deletions
+10 -2
......@@ -155,6 +155,10 @@ CVS code -
execute_command()
- Remove the marking of the file as modified, as do_insertfile()
now handles that. (DLR)
- utils.c:
digits()
- Tweak to remove the assumption that n is always positive,
although it always is in this particular case. (DLR)
- winio.c:
parse_kbinput()
- Properly handle combined meta and escape sequences, so that
......
......@@ -35,8 +35,12 @@ int digits(size_t n)
{
int i;
for (i = 1; n >= 10; n /= 10, i++)
;
if (n == 0)
i = 1;
else {
for (i = 0; n != 0; n /= 10, i++)
;
}
return i;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment