[vorbis-dev] PATCH: utf8 implementation for oggenc

Daniel Resare noa at metamatrix.se
Tue Mar 20 02:46:45 PST 2001



On Mon, Mar 19, 2001 at 08:01:37PM -0500, Andy wrote:
> 
> Call me crazy, but the code sequence:
> 
> +       if (!strcasecmp(encoding, "UTF-8")) {
> +               /* ideally some checking of the given string should be done */
> +               *to = malloc(strlen(from) + 1);
> +               strcpy(from, *to);
> +               return 0;
> +       }
> 
> Looks pretty messed up...
> 
> I don't think this would have happened at all if "from" had been
> declared "const char*" rather than just "char*".
> 
> When something is const, declaring it as such can be a boon.
> 
> I didn't review the code much further, this one was too easy :-)
> 
> 
> Best regards,
>  Andy
> 

oops. *blush*. Changed to 'const char*' and flipped the args.
a new diff is available from http://noa.tm/oggenc-utf8.2.diff.gz

/daniel


-- 
nuclear cia fbi spy password code president bomb
8D97 F297 CA0D 8751 D8EB  12B6 6EA6 727F 9B8D EC2A

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list