--- libaitrpc/src/builtin.c 2011/09/07 00:30:04 1.3.2.9 +++ libaitrpc/src/builtin.c 2011/09/07 07:24:21 1.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: builtin.c,v 1.3.2.9 2011/09/07 00:30:04 misho Exp $ +* $Id: builtin.c,v 1.4 2011/09/07 07:24:21 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -244,6 +244,12 @@ rpcBLOBServerVars(rpc_func_t *call, int ic, array_t *i for (i = 0, b = srv->srv_blob.blobs; b; i++, b = b->blob_next); len = i * sizeof str; + if (!len) { + AIT_SET_STR(io_array(vals, 0, ait_val_t*), ""); + pthread_mutex_unlock(&srv->srv_blob.mtx); + return 0; + } + if (!(val = malloc(len))) { LOGERR; pthread_mutex_unlock(&srv->srv_blob.mtx); @@ -253,7 +259,7 @@ rpcBLOBServerVars(rpc_func_t *call, int ic, array_t *i for (b = srv->srv_blob.blobs, i = 0; b; i++, b = b->blob_next) { memset(str, 0, sizeof str); - snprintf(str, sizeof str, "0x%0X(%lu)=%p ", b->blob_var, b->blob_len, b->blob_data); + snprintf(str, sizeof str, "0x%0X(%lu)=%p ", b->blob_var, (u_long) b->blob_len, b->blob_data); strlcat(val, str, len); }