[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Some minor fixes for gnokii
From: |
Pawel Kot |
Subject: |
Re: Some minor fixes for gnokii |
Date: |
Tue, 29 Oct 2002 21:29:45 +0100 (CET) |
On Sat, 26 Oct 2002, Jan de Cuveland wrote:
Hi,
> I was trying to write my phonebook into my 6510 using the current CVS
> version of gnokii and ran into some problems.
>
> Now with some minor fixes everything runs fine for me. So I would like to
> ask the developers to consider adding my patches to the CVS.
Thanks for your interest and work on gnokii. You'll find the comments
below.
> What do the patches do?
> * The first corrects an obvious mistake (?) in gnooki.c.
if (argc && (strcmp("-i", args[0])) && (strcmp("-v", args[0])))
usage(stderr);
- if (!strcmp("-v", args[0]))
+ if (argc && !strcmp("-v", args[0]))
That's not needed. usage() does exit program. I think I'll add an argument
int retval to this function as `gnokii --help` exits with -1.
The other part (memory_type_string) is certainly OK.
> * The second increases the size of a struct. This is necessary because
> otherwise gnokii segfaults with some large entries. (There is no range
> checking, so gnokii overwrites the return address -> bad!)
I'll try to do this "more correct". We definitely need range checking
there. Thanks for spotting.
> * The third is a patch to /common/gsm-encoding.c. The problem is, that
> mbtowc and wctomb do not work as desired with the special characters of
> a latin1 charset.
Could you put more light on this? Some example?
> Returning -1 is anyway a bad idea, since it
> effectively deletes the previous character of the string as well.
> Since I only changed the behaviour in case of error, I think these
> modifications will not break anything.
Yeah, good point. I'd prefer though to set '?' as the returned character.
So, I'll just modify the return value there with the option to modify
*dest as well when you convince me to do it.
Thanks again. Committing to CVS.
pkot
--
mailto:address@hidden :: mailto:address@hidden
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku