Aaron Burrow wrote: > This patch fixes three things that seemed off to me. > > 1. If you enter a count that is too large for a long; you just get the > arbitrary value 999999999L. This patch causes normal_cmd(...) to fail. > > 2. If you try to read a value from the screen (with ctrla/ctrlx) that > causes an overflow, vim will just use the part of the value coming after > the overflow; this patch ``does nothing'' instead. > > 3. If your ctrla/ctrlx produces a value that causes an unsigned overflow, > vim will do wrapping for decimal, hex and octal. I think that it should > not wrap for decimal and instead do nothing. > > At the very least, I think it is much saner to use strtoul(...) in > vim_str2nr(...) as opposed to the rollyourown solution. > > Patch attached.
How much of this is covered by tests? Does strtoul() work properly on all platforms? -- hundred-and-one symptoms of being an internet addict: 42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
