summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-01-04 12:28:20 +0100
committerJeremy Allison <jra@samba.org>2021-01-12 00:10:30 +0000
commit8c02ebdbf84cc8141754313c0b5bb0ee1c56afb2 (patch)
tree0dc6d6ed58cdcacec4faeb6cab3fdf6d5665a733 /lib/util
parent8f08390c282c19f866fe75a8115dcdecb6fe5d68 (diff)
downloadsamba-8c02ebdbf84cc8141754313c0b5bb0ee1c56afb2.tar.gz
lib: Simplify "weird" charset code
Don't depend on DEBUG. This is a pure developer module, the developer should be able to figure out what's going on after this has abort()ed. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/charset/weird.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/lib/util/charset/weird.c b/lib/util/charset/weird.c
index 79b07b022a1..9752e01e323 100644
--- a/lib/util/charset/weird.c
+++ b/lib/util/charset/weird.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
#include "charset_proto.h"
#ifdef DEVELOPER
@@ -54,19 +54,17 @@ size_t weird_pull(void *cd, const char **inbuf, size_t *inbytesleft,
weird_table[i].to,
weird_table[i].len) == 0) {
if (*inbytesleft < weird_table[i].len) {
- DEBUG(0,("ERROR: truncated weird string\n"));
- /* smb_panic("weird_pull"); */
-
- } else {
- (*outbuf)[0] = weird_table[i].from;
- (*outbuf)[1] = 0;
- (*inbytesleft) -= weird_table[i].len;
- (*outbytesleft) -= 2;
- (*inbuf) += weird_table[i].len;
- (*outbuf) += 2;
- done = 1;
- break;
+ abort();
}
+
+ (*outbuf)[0] = weird_table[i].from;
+ (*outbuf)[1] = 0;
+ (*inbytesleft) -= weird_table[i].len;
+ (*outbytesleft) -= 2;
+ (*inbuf) += weird_table[i].len;
+ (*outbuf) += 2;
+ done = 1;
+ break;
}
}
if (done) continue;
@@ -98,18 +96,17 @@ size_t weird_push(void *cd, const char **inbuf, size_t *inbytesleft,
if ((*inbuf)[0] == weird_table[i].from &&
(*inbuf)[1] == 0) {
if (*outbytesleft < weird_table[i].len) {
- DEBUG(0,("No room for weird character\n"));
- /* smb_panic("weird_push"); */
- } else {
- memcpy(*outbuf, weird_table[i].to,
- weird_table[i].len);
- (*inbytesleft) -= 2;
- (*outbytesleft) -= weird_table[i].len;
- (*inbuf) += 2;
- (*outbuf) += weird_table[i].len;
- done = 1;
- break;
+ abort();
}
+ memcpy(*outbuf,
+ weird_table[i].to,
+ weird_table[i].len);
+ (*inbytesleft) -= 2;
+ (*outbytesleft) -= weird_table[i].len;
+ (*inbuf) += 2;
+ (*outbuf) += weird_table[i].len;
+ done = 1;
+ break;
}
}
if (done) continue;