aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/gnunet-scalarproduct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalarproduct/gnunet-scalarproduct.c')
-rw-r--r--src/scalarproduct/gnunet-scalarproduct.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/scalarproduct/gnunet-scalarproduct.c b/src/scalarproduct/gnunet-scalarproduct.c
index b3b954211..be56a44f0 100644
--- a/src/scalarproduct/gnunet-scalarproduct.c
+++ b/src/scalarproduct/gnunet-scalarproduct.c
@@ -243,13 +243,20 @@ run (void *cls,
243 input_peer_id); 243 input_peer_id);
244 return; 244 return;
245 } 245 }
246 246 if ( ('\'' == *begin) &&
247 ('\'' == begin[strlen(begin)-1]) )
248 {
249 begin[strlen(begin)-1] = '\0';
250 if (strlen (begin) > 0)
251 begin++;
252 }
247 for (end = begin; 0 != *end; end++) 253 for (end = begin; 0 != *end; end++)
248 if (*end == ';') 254 if (*end == ';')
249 element_count++; 255 element_count++;
250 if (0 == element_count) { 256 if (0 == element_count)
257 {
251 LOG (GNUNET_ERROR_TYPE_ERROR, 258 LOG (GNUNET_ERROR_TYPE_ERROR,
252 _("Need elements to compute the vectorproduct, got none.\n")); 259 _("Need elements to compute the scalarproduct, got none.\n"));
253 return; 260 return;
254 } 261 }
255 262
@@ -276,9 +283,8 @@ run (void *cls,
276 GNUNET_free (elements); 283 GNUNET_free (elements);
277 return; 284 return;
278 } 285 }
279
280 /* read the element's key */
281 *separator = 0; 286 *separator = 0;
287 /* read the element's key */
282 GNUNET_CRYPTO_hash (begin, 288 GNUNET_CRYPTO_hash (begin,
283 strlen (begin), 289 strlen (begin),
284 &element.key); 290 &element.key);
@@ -316,7 +322,8 @@ run (void *cls,
316 &responder_callback, 322 &responder_callback,
317 NULL))) ) ) 323 NULL))) ) )
318 { 324 {
319 GNUNET_break (0); 325 fprintf (stderr,
326 _("Failed to initiate computation, were all keys unique?\n"));
320 GNUNET_free (elements); 327 GNUNET_free (elements);
321 return; 328 return;
322 } 329 }