1
0
Fork 0
mirror of git://git.psyc.eu/libpsyc synced 2024-08-15 03:19:02 +00:00

fix for 0 length content/modifiers

This commit is contained in:
tg(x) 2011-05-04 17:46:20 +02:00
parent a67cc24c40
commit e7a4df6180
4 changed files with 37 additions and 26 deletions

View file

@ -9,6 +9,8 @@ uint8_t verbose;
psycTextValueRC getValueFooBar (const char *name, size_t len, psycString *value)
{
if (verbose)
printf("> getValue: %.*s\n", (int)len, name);
value->ptr = "Foo Bar";
value->length = 7;
return PSYC_TEXT_VALUE_FOUND;
@ -16,6 +18,8 @@ psycTextValueRC getValueFooBar (const char *name, size_t len, psycString *value)
psycTextValueRC getValueEmpty (const char *name, size_t len, psycString *value)
{
if (verbose)
printf("> getValue: %.*s\n", (int)len, name);
value->ptr = "";
value->length = 0;
return PSYC_TEXT_VALUE_FOUND;
@ -23,6 +27,8 @@ psycTextValueRC getValueEmpty (const char *name, size_t len, psycString *value)
psycTextValueRC getValueNotFound (const char *name, size_t len, psycString *value)
{
if (verbose)
printf("> getValue: %.*s\n", (int)len, name);
return PSYC_TEXT_VALUE_NOT_FOUND;
}