cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

fixes parameter of sizeof in {test_prefix,ccn-lite-rpc}.c #343

Closed mfrey closed 5 years ago

mfrey commented 5 years ago

Contribution description

The PR fixes the size of two calls to sizeof. During the last cleanup (see also #337) the size of some length parameter changed from int to size_t. Hence, a call to sizeof needed to be changed from int to size_t in test_prefix.c. The other parameter was changed from an int to struct rdr_ds_s inccn-lite-rpc.c

Issues/PRs references

Fixes #324

blacksheeep commented 5 years ago

Ok, so we do not change this?

On Thu 31. Jan 2019 at 16:57, Michael Frey notifications@github.com wrote:

@mfrey commented on this pull request.

In src/ccnl-utils/src/ccn-lite-rpc.c https://github.com/cn-uofbasel/ccn-lite/pull/343#discussion_r252726044:

@@ -370,7 +370,7 @@ main(int argc, char *argv[]) return -1; } nonce->type = LRPC_NONCE;

  • nonce->aux = malloc(sizeof(int));
  • nonce->aux = malloc(sizeof(struct rdr_ds_s)); memcpy(nonce->aux, &n, sizeof(int));

this inits the first int in the struct? right?

I would have said that this initialises a nested element of type struct rdr_ds_s (a bit like a next pointer to the next element in a list).

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/cn-uofbasel/ccn-lite/pull/343#discussion_r252726044, or mute the thread https://github.com/notifications/unsubscribe-auth/ADeQ_bjRO3Gt3X4_m1LGTBBNDXTGPMRtks5vIxJIgaJpZM4acg7i .

-- Christopher Scherb, MSc University of Basel Computer Network Group Room 04.004 Spiegelgasse 1 CH-4051 Basel, Switzerland E-Mail: christopher.scherb@unibas.ch