[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ODP: [elmo-users] drobiazgi
From: |
Szymon |
Subject: |
Re: ODP: [elmo-users] drobiazgi |
Date: |
Thu, 25 Sep 2003 22:46:28 +0200 |
User-agent: |
elmo/0.8.3 |
Zrobiłem funkcję która przekonuje mnie że chyba jednak powinno być +1.
(elmo skompilowany z taki czymś wypisuje kilka razy ,,zdechłom'')
------------------------
static void
make_initials (address_t *addr, memblock_t **data_block)
{
int len;
int first = 1;
char *seek;
char *initials;
char *iseek;
if (addr->name == NULL)
return;
len = strlen (addr->name);
if (len < 1)
return;
iseek = initials = xmalloc (len);
{ /* ten nawias tylko do celów testowych */
unsigned int tttt = (unsigned int)initials + len;
for (seek = addr->name; *seek; seek++){
if (isalpha (*seek) && first) { *iseek = *seek; first = 0; iseek++; }
else if (isspace (*seek)) { first = 1; }}
if ((unsigned int)iseek == tttt) fprintf (stderr, "%s\n", "zdechłom");
*iseek = '\0';
} /* ten nawias tylko do celów testowych */
addr->initials = memblock_strdup (data_block, initials);
xfree (initials);
}
------------------------