diff options
author | Pierre Ossman <ossman@cendio.se> | 2023-01-23 20:04:15 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2023-02-04 14:03:13 +0100 |
commit | 3143bfa1545c2aa70781c5c780df7e66f123614f (patch) | |
tree | d1541a4516a248202d7f23ab08be11b7dbc3ed07 /common | |
parent | 4293dc42f60fff4542162deba616ec99b2d9fd09 (diff) | |
download | tigervnc-3143bfa1545c2aa70781c5c780df7e66f123614f.tar.gz tigervnc-3143bfa1545c2aa70781c5c780df7e66f123614f.zip |
Use standard C string functions
It's just confusing that we have our own variety that isn't compatible.
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/util.cxx | 25 | ||||
-rw-r--r-- | common/rfb/util.h | 9 |
2 files changed, 0 insertions, 34 deletions
diff --git a/common/rfb/util.cxx b/common/rfb/util.cxx index 0df9e1e3..22918cf9 100644 --- a/common/rfb/util.cxx +++ b/common/rfb/util.cxx @@ -32,18 +32,6 @@ namespace rfb { - char* strDup(const char* s) { - if (!s) return 0; - int l = strlen(s); - char* r = new char[l+1]; - memcpy(r, s, l+1); - return r; - }; - - void strFree(char* s) { - delete [] s; - } - std::string strFormat(const char *fmt, ...) { va_list ap; @@ -91,19 +79,6 @@ namespace rfb { return out; } - bool strContains(const char* src, char c) { - int l=strlen(src); - for (int i=0; i<l; i++) - if (src[i] == c) return true; - return false; - } - - void strCopy(char* dest, const char* src, int destlen) { - if (src) - strncpy(dest, src, destlen-1); - dest[src ? destlen-1 : 0] = 0; - } - static char intToHex(uint8_t i) { if (i<=9) return '0'+i; diff --git a/common/rfb/util.h b/common/rfb/util.h index 799e0756..1e59de62 100644 --- a/common/rfb/util.h +++ b/common/rfb/util.h @@ -34,9 +34,6 @@ struct timeval; namespace rfb { - char* strDup(const char* s); - void strFree(char* s); - // Formats according to printf(), with a dynamic allocation std::string strFormat(const char *fmt, ...) __attribute__((__format__ (__printf__, 1, 2))); @@ -45,12 +42,6 @@ namespace rfb { std::vector<std::string> strSplit(const char* src, const char delimiter); - // Returns true if src contains c - bool strContains(const char* src, char c); - - // Copies src to dest, up to specified length-1, and guarantees termination - void strCopy(char* dest, const char* src, int destlen); - // Conversion to and from a hex string void binToHex(const uint8_t* in, size_t inlen, char* out, size_t outlen); |