On Thu, Mar 25, 2010 at 2:35 PM, Liu Aleaxander <aleaxander@xxxxxxxxx> wrote: > On Thu, Mar 25, 2010 at 2:19 PM, Américo Wang <xiyou.wangcong@xxxxxxxxx> wrote: >> On Thu, Mar 25, 2010 at 2:16 PM, Liu Aleaxander <aleaxander@xxxxxxxxx> wrote: >>> On Thu, Mar 25, 2010 at 1:50 PM, Américo Wang <xiyou.wangcong@xxxxxxxxx> wrote: > [ snip ] >>> >>> If so, I don't think so this can handle the case like the following one: >>> /sbin/losetup -o 0x7e00fdjfkk /dev/loop0 disk.img >> >> Why not refer man pages? Everything is clear: >> >> If endptr is not NULL, strtoul() stores the address of the first >> invalid character in *endptr. If there were no digits at all, str- >> toul() stores the original value of nptr in *endptr (and returns 0). >> In particular, if *nptr is not '\0' but **endptr is '\0' on return, the >> entire string is valid. > > Hi, > Am I miss something, or misunderstood something? > > In fact, I did just by what the man page said: > In particular, if *nptr is not '\0' but **endptr is '\0' on return, the > entire string is valid. > Alright, I thought if !*offset, 'end' will be not changed, but it should be the case "no digits" after checking the source code, thus will have same value with 'offset'. :-/ So your change ought to be correct. Thanks. -- To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html