gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Escaping special characters in phonebooks raw mode


From: michael bode
Subject: Escaping special characters in phonebooks raw mode
Date: Mon, 10 Dec 2007 00:09:08 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071022)

Hi,

I've encountered a problem with insufficient escaped special characters in raw mode phonebooks with my Nokia 6230. A subentry of type postal address can contain newlines (or even ';') which are not escaped in gn_file_phonebook_raw_write().


     /gnokii/common/gsm-filetypes.c

GNOKII_API gn_error gn_file_phonebook_raw_write(FILE *f, gn_phonebook_entry 
*entry, char *memory_type_string)
{
        char escaped_name[2 * GN_PHONEBOOK_NAME_MAX_LENGTH];
        int i;

        add_slashes(escaped_name, entry->name, sizeof(escaped_name), 
strlen(entry->name));
        fprintf(f, "%s;%s;%s;%d;%d", escaped_name,
                entry->number, memory_type_string,
                entry->location, entry->caller_group);
        if (entry->person.has_person) {
                if (entry->person.honorific_prefixes[0])
                        fprintf(f, ";%d;0;0;%s", GN_PHONEBOOK_ENTRY_FormalName,
                                entry->person.honorific_prefixes);
                if (entry->person.given_name[0])
                        fprintf(f, ";%d;0;0;%s", GN_PHONEBOOK_ENTRY_FirstName,
                                entry->person.given_name);
                if (entry->person.family_name[0])
                        fprintf(f, ";%d;0;0;%s", GN_PHONEBOOK_ENTRY_LastName,
                                entry->person.family_name);
        }
        if (entry->address.has_address) {
                // *** 6230's postal address goes here unescaped ***
                if (entry->address.post_office_box[0])
                        fprintf(f, ";%d;0;0;%s", GN_PHONEBOOK_ENTRY_Postal,
                                entry->address.post_office_box);

Is there a good reason for this or is it just an oversight?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]