[M] Change in openvpn[master]: options: Move string utility functions to buffer
"flichtenheld \(Code Review\) via Openvpn-devel" <[email protected]>
| Newsgroups | gmane.network.openvpn.devel |
|---|---|
| Message-ID | <ddf5de585a146d5b89a5a045c2adb75eb9721270-EmailReplacePatchSet-HTML@gerrit.openvpn.net> |
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, razvanc,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1775?usp=email
to look at the new patch set (#3).
The change is no longer submittable: checks~ChecksSubmitRule is unsatisfied now.
Change subject: options: Move string utility functions to buffer
......................................................................
options: Move string utility functions to buffer
buffer seems to be where we collect string utility
functions, so move them out of options.
Change-Id: I09ad0d9baaa7351eecb5aafdb5c6e7b47cf7c909
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M src/openvpn/buffer.c
M src/openvpn/buffer.h
M src/openvpn/options.c
M src/openvpn/options.h
4 files changed, 35 insertions(+), 34 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/75/1775/3
diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c
index 87d3094..a004b60 100644
--- a/src/openvpn/buffer.c
+++ b/src/openvpn/buffer.c
@@ -1086,6 +1086,38 @@
}
bool
+string_defined_equal(const char *s1, const char *s2)
+{
+ if (s1 && s2)
+ {
+ return !strcmp(s1, s2);
+ }
+ else
+ {
+ return false;
+ }
+}
+
+char *
+string_substitute(const char *src, char from, char to, struct gc_arena *gc)
+{
+ char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc);
+ char *dest = ret;
+ char c;
+
+ do
+ {
+ c = *src++;
+ if (c == from)
+ {
+ c = to;
+ }
+ *dest++ = c;
+ } while (c);
+ return ret;
+}
+
+bool
checked_snprintf(char *str, size_t size, const char *format, ...)
{
va_list arglist;
diff --git a/src/openvpn/buffer.h b/src/openvpn/buffer.h
index 81e247b..ab8c239 100644
--- a/src/openvpn/buffer.h
+++ b/src/openvpn/buffer.h
@@ -1766,6 +1766,9 @@
return 0 == strncmp(str, prefix, strlen(prefix));
}
+bool string_defined_equal(const char *s1, const char *s2);
+char *string_substitute(const char *src, char from, char to, struct gc_arena *gc);
+
/**
* Like snprintf() but returns an boolean.
*
diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 3382138..74b1f25 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -1104,25 +1104,6 @@
return get_ipv6_addr(ipv6_prefix_spec, NULL, NULL, M_WARN);
}
-static char *
-string_substitute(const char *src, char from, char to, struct gc_arena *gc)
-{
- char *ret = (char *)gc_malloc(strlen(src) + 1, true, gc);
- char *dest = ret;
- char c;
-
- do
- {
- c = *src++;
- if (c == from)
- {
- c = to;
- }
- *dest++ = c;
- } while (c);
- return ret;
-}
-
/**
* Parses a hexstring and checks if the string has the correct length. Return
* a verify_hash_list containing the parsed hash string.
@@ -3582,19 +3563,6 @@
}
}
-bool
-string_defined_equal(const char *s1, const char *s2)
-{
- if (s1 && s2)
- {
- return !strcmp(s1, s2);
- }
- else
- {
- return false;
- }
-}
-
#if 0
static void
ping_rec_err(msglvl_t msglevel)
diff --git a/src/openvpn/options.h b/src/openvpn/options.h
index 0fd505a..c23d0b3 100644
--- a/src/openvpn/options.h
+++ b/src/openvpn/options.h
@@ -901,8 +901,6 @@
void setenv_settings(struct env_set *es, const struct options *o);
-bool string_defined_equal(const char *s1, const char *s2);
-
void options_postprocess(struct options *options, struct env_set *es);
bool options_postprocess_pull(struct options *o, struct env_set *es);
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1775?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09ad0d9baaa7351eecb5aafdb5c6e7b47cf7c909
Gerrit-Change-Number: 1775
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-Reviewer: razvanc <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel