Re: [gnet] gnet_sha_new_string Assertion failing, yet condition is met..
- From: David Helder <dhelder gizmolabs org>
- To: richardc cybrick com
- Cc: gnet gnetlibrary org
- Subject: Re: [gnet] gnet_sha_new_string Assertion failing, yet condition is met..
- Date: 30 Jul 2003 09:45:07 -0400
That looks right. A SHA is 20 bytes, so the string should be 40 bytes
long. And your string is. The assertion that's failing is the second
assertion in the function. Nothing is done to the string.
Does tests/hash_test pass on your system?
Is your string NULL terminated?
David
On Tue, 2003-07-29 at 21:12, Richard Clark wrote:
> GNet-CRITICAL **: file sha.c: line 482 (gnet_sha_new_string): assertion
> `strlen(str) == (GNET_SHA_HASH_LENGTH * 2)' failed
>
> Here is my latest code segment..
>
> g_return_val_if_fail(strlen("2db47192c71dcd447d0146c85de23724e1b7615c")==(GNET_SHA_HASH_LENGTH*
> 2), -1);
> hash_sent = gnet_sha_new_string("2db47192c71dcd447d0146c85de23724e1b7615c");
>
> I was getting frustrated, so I have gone so far is to put a hard coded sha
> hash there as well as the same assert check from the gnet_sha_new_string
> source code.. My assert passes, yet it fails in sha.c..
>
> There is probably something simple I am missing, but I can't see it.
>
> Any ideas ?
>
>
>
> _______________________________________________
> gnet mailing list
> gnet gnetlibrary org
> http://www.gnetlibrary.org/mailman/listinfo/gnet
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]