avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
avahi is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
You should have received a copy of the GNU Lesser General Public
License along with avahi; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
int avahi_string_list_parse(const void* data, size_t size, AvahiStringList **ret) {
const uint8_t *c;
AvahiStringList *r = NULL;
int avahi_string_list_parse(const void* data, size_t size, AvahiStringList **ret) {
const uint8_t *c;
AvahiStringList *r = NULL;
/* Empty lists are treated specially. To comply with
* section 6.1 of the DNS-SD spec, we return a single
* empty string (i.e. a NUL byte)*/
/* Empty lists are treated specially. To comply with
* section 6.1 of the DNS-SD spec, we return a single
* empty string (i.e. a NUL byte)*/
AvahiStringList *avahi_string_list_add_vprintf(AvahiStringList *l, const char *format, va_list va) {
size_t len = 80;
AvahiStringList *r;
AvahiStringList *avahi_string_list_add_vprintf(AvahiStringList *l, const char *format, va_list va) {
size_t len = 80;
AvahiStringList *r;
-
- n = vsnprintf((char*) r->text, len+1, format, va);
+ va_list va2;
+
+ va_copy(va2, va);
+ n = vsnprintf((char*) r->text, len, format, va2);
+ va_end(va2);
int avahi_string_list_get_pair(AvahiStringList *l, char **key, char **value, size_t *size) {
char *e;
int avahi_string_list_get_pair(AvahiStringList *l, char **key, char **value, size_t *size) {
char *e;
if (!(f = avahi_string_list_find(l, AVAHI_SERVICE_COOKIE)))
return AVAHI_SERVICE_COOKIE_INVALID;
if (!(f = avahi_string_list_find(l, AVAHI_SERVICE_COOKIE)))
return AVAHI_SERVICE_COOKIE_INVALID;