revision: parse "git log -<count>" more carefully
commite3fa568cb397a78a56716137c826f21f5e0b0a77
authorJunio C Hamano <gitster@pobox.com>
Fri, 6 Jun 2014 22:33:25 +0000 (6 15:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Jun 2014 21:53:49 +0000 (9 14:53 -0700)
tree24f341eb3297d88a6cd3e21bbfe3110e2237d046
parent7bbc4e8fdb33e0a8e42e77cc05460d4c4f615f4d
revision: parse "git log -<count>" more carefully

This mistyped command line simply ignores "master" and ends up
showing two commits from the current HEAD:

    $ git log -2master

because we feed "2master" to atoi() without making sure that the
whole string is parsed as an integer.

Use the strtol_i() helper function instead.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c