1 From 0da5428bdfe67eb17ee03f22f68e66b044abdf70 Mon Sep 17 00:00:00 2001
2 From: Fabrice Fontaine <fabrice.fontaine@orange.com>
3 Date: Sun, 30 Oct 2016 19:30:46 +0100
4 Subject: [PATCH] Rename base64_encode
6 base64_encode is already defined in gnutls so rename it as
7 motion_base64_encode to prevent a definition clash when linking
11 - http://autobuild.buildroot.org/results/592672b8826f4c731c50d29725da964d876573c4
14 - https://github.com/Motion-Project/motion/commit/cc3c25527d4bada0fe98a734fa2df29f8d6cf1ad
16 Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
19 netcam_wget.c | 4 ++--
23 5 files changed, 9 insertions(+), 9 deletions(-)
25 diff --git a/netcam.c b/netcam.c
26 index a9df33a..38d4ca3 100644
29 @@ -2019,7 +2019,7 @@ static int netcam_http_build_url(netcam_context_ptr netcam, struct url_t *url)
33 - /* base64_encode needs up to 3 additional chars. */
34 + /* motion_base64_encode needs up to 3 additional chars. */
36 userpass = mymalloc(strlen(ptr) + 3);
37 strcpy(userpass, ptr);
38 @@ -2045,7 +2045,7 @@ static int netcam_http_build_url(netcam_context_ptr netcam, struct url_t *url)
39 /* Allocate space for the base64-encoded string. */
40 encuserpass = mymalloc(BASE64_LENGTH(strlen(userpass)) + 1);
41 /* Fill in the value. */
42 - base64_encode(userpass, encuserpass, strlen(userpass));
43 + motion_base64_encode(userpass, encuserpass, strlen(userpass));
44 /* Now create the last part (authorization) of the request. */
45 request_pass = mymalloc(strlen(connect_auth_req) +
46 strlen(encuserpass) + 1);
47 diff --git a/netcam_wget.c b/netcam_wget.c
48 index 4491760..f5c1dc2 100644
51 @@ -210,13 +210,13 @@ int skip_lws(const char *string)
56 + * motion_base64_encode
58 * Encode the string S of length LENGTH to base64 format and place it
59 * to STORE. STORE will be 0-terminated, and must point to a writable
60 * buffer of at least 1+BASE64_LENGTH(length) bytes.
62 -void base64_encode(const char *s, char *store, int length)
63 +void motion_base64_encode(const char *s, char *store, int length)
65 /* Conversion table. */
66 static const char tbl[64] = {
67 diff --git a/netcam_wget.h b/netcam_wget.h
68 index 9a091bf..e9b02b5 100644
71 @@ -72,7 +72,7 @@ int rbuf_read_bufferful(netcam_context_ptr);
72 /* How many bytes it will take to store LEN bytes in base64. */
73 #define BASE64_LENGTH(len) (4 * (((len) + 2) / 3))
75 -void base64_encode(const char *, char *, int);
76 +void motion_base64_encode(const char *, char *, int);
77 char *strdupdelim(const char *, const char *);
78 int http_process_type(const char *, void *);
80 diff --git a/stream.c b/stream.c
81 index 04e67ee..ca201ac 100644
84 @@ -211,10 +211,10 @@ static void* handle_basic_auth(void* param)
86 authentication = mymalloc(BASE64_LENGTH(auth_size) + 1);
87 userpass = mymalloc(auth_size + 4);
88 - /* base64_encode can read 3 bytes after the end of the string, initialize it. */
89 + /* motion_base64_encode can read 3 bytes after the end of the string, initialize it. */
90 memset(userpass, 0, auth_size + 4);
91 strcpy(userpass, p->conf->stream_authentication);
92 - base64_encode(userpass, authentication, auth_size);
93 + motion_base64_encode(userpass, authentication, auth_size);
96 if (strcmp(auth, authentication)) {
97 diff --git a/webhttpd.c b/webhttpd.c
98 index 6df2d11..36e8beb 100644
101 @@ -2616,10 +2616,10 @@ void httpd_run(struct context **cnt)
103 authentication = mymalloc(BASE64_LENGTH(auth_size) + 1);
104 userpass = mymalloc(auth_size + 4);
105 - /* base64_encode can read 3 bytes after the end of the string, initialize it */
106 + /* motion_base64_encode can read 3 bytes after the end of the string, initialize it */
107 memset(userpass, 0, auth_size + 4);
108 strcpy(userpass, cnt[0]->conf.webcontrol_authentication);
109 - base64_encode(userpass, authentication, auth_size);
110 + motion_base64_encode(userpass, authentication, auth_size);