diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-07 06:19:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-07 06:19:33 +0000 |
commit | 36ac7973809d0dae4eafb438c63a288c349c38f5 (patch) | |
tree | 6347bc183cc50c32d491391702f1a5e4b67daa61 | |
parent | 8208f31a43bdb5fd079b4124c2a47ef01b5bb5b8 (diff) | |
download | libmicrohttpd-36ac7973809d0dae4eafb438c63a288c349c38f5.tar.gz libmicrohttpd-36ac7973809d0dae4eafb438c63a288c349c38f5.zip |
-use more portable rand instead of random
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/examples/post_example.c | 12 |
3 files changed, 10 insertions, 6 deletions
@@ -23,6 +23,7 @@ Colin Caughie <c.caughie@indigovision.com> | |||
23 | David Carvalho <andaris@gmail.com> | 23 | David Carvalho <andaris@gmail.com> |
24 | David Reiss <dreiss@facebook.com> | 24 | David Reiss <dreiss@facebook.com> |
25 | Matt Holiday | 25 | Matt Holiday |
26 | Michael Cronenworth <mike@cchtml.com> | ||
26 | Mika Raento <mikie@iki.fi> | 27 | Mika Raento <mikie@iki.fi> |
27 | Mike Crowe <mac@mcrowe.com> | 28 | Mike Crowe <mac@mcrowe.com> |
28 | John Muth <muth@parascale.com> | 29 | John Muth <muth@parascale.com> |
@@ -1,3 +1,6 @@ | |||
1 | Wed Aug 7 08:17:40 CEST 2013 | ||
2 | Removing dependency on PlibC. -MC | ||
3 | |||
1 | Fri Aug 2 20:55:47 CEST 2013 | 4 | Fri Aug 2 20:55:47 CEST 2013 |
2 | Fix HTTP 1.1 compliance with respect to not returning | 5 | Fix HTTP 1.1 compliance with respect to not returning |
3 | content-length headers for successful "CONNECT" requests. | 6 | content-length headers for successful "CONNECT" requests. |
diff --git a/src/examples/post_example.c b/src/examples/post_example.c index 528b8678..173a1353 100644 --- a/src/examples/post_example.c +++ b/src/examples/post_example.c | |||
@@ -180,10 +180,10 @@ get_session (struct MHD_Connection *connection) | |||
180 | snprintf (ret->sid, | 180 | snprintf (ret->sid, |
181 | sizeof (ret->sid), | 181 | sizeof (ret->sid), |
182 | "%X%X%X%X", | 182 | "%X%X%X%X", |
183 | (unsigned int) random (), | 183 | (unsigned int) rand (), |
184 | (unsigned int) random (), | 184 | (unsigned int) rand (), |
185 | (unsigned int) random (), | 185 | (unsigned int) rand (), |
186 | (unsigned int) random ()); | 186 | (unsigned int) rand ()); |
187 | ret->rc++; | 187 | ret->rc++; |
188 | ret->start = time (NULL); | 188 | ret->start = time (NULL); |
189 | ret->next = sessions; | 189 | ret->next = sessions; |
@@ -319,7 +319,7 @@ fill_v1_form (const void *cls, | |||
319 | 319 | ||
320 | reply = malloc (strlen (form) + strlen (session->value_1) + 1); | 320 | reply = malloc (strlen (form) + strlen (session->value_1) + 1); |
321 | if (NULL == reply) | 321 | if (NULL == reply) |
322 | return NULL; | 322 | return MHD_NO; |
323 | snprintf (reply, | 323 | snprintf (reply, |
324 | strlen (form) + strlen (session->value_1) + 1, | 324 | strlen (form) + strlen (session->value_1) + 1, |
325 | form, | 325 | form, |
@@ -715,7 +715,7 @@ main (int argc, char *const *argv) | |||
715 | return 1; | 715 | return 1; |
716 | } | 716 | } |
717 | /* initialize PRNG */ | 717 | /* initialize PRNG */ |
718 | srandom ((unsigned int) time (NULL)); | 718 | srand ((unsigned int) time (NULL)); |
719 | d = MHD_start_daemon (MHD_USE_DEBUG, | 719 | d = MHD_start_daemon (MHD_USE_DEBUG, |
720 | atoi (argv[1]), | 720 | atoi (argv[1]), |
721 | NULL, NULL, | 721 | NULL, NULL, |