[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Scheme function ly:string->duration
From: |
Neil Puttock |
Subject: |
Re: [PATCH] Scheme function ly:string->duration |
Date: |
Sat, 17 May 2008 13:31:31 +0100 |
Thanks for your comments, Joe.
I'm struggling a bit with sscanf () though. I tried your suggestion of
if (sscanf (s.c_str (), "%d") != s.size ()) ...
but it fails with a segfault; when compiling, I get two warnings: that
there's not enough arguments to sscanf (), and about type conversion
(shouldn't s.size () be cast as int for this comparison?)
It works OK (ignoring the cast) if I change it to
if (sscanf (s.c_str (), "%d", &len) != s.size ()) ...
but I'm a bit confused here: doesn't sscanf () return the number of
variables which have successfully been assigned values? If so, how can
the test work?
Thanks,
Neil