From 61bc2485555c5001b02debad0909000a8e2faf3b Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 8 Jan 2017 15:27:48 +0100
Subject: [PATCH] tweaks: chuck a couple of useless asserts

---
 src/browser.c | 4 ----
 src/color.c   | 4 ----
 src/cut.c     | 6 ------
 3 files changed, 14 deletions(-)

diff --git a/src/browser.c b/src/browser.c
index 4605ff8d..b3742f1a 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -344,8 +344,6 @@ char *do_browse_from(const char *inpath)
     char *path;
 	/* This holds the tilde-expanded version of inpath. */
 
-    assert(inpath != NULL);
-
     path = real_dir_from_tilde(inpath);
 
     /* Perhaps path is a directory.  If so, we'll pass it to
@@ -790,8 +788,6 @@ char *striponedir(const char *path)
 {
     char *retval, *tmp;
 
-    assert(path != NULL);
-
     retval = mallocstrcpy(NULL, path);
 
     tmp = strrchr(retval, '/');
diff --git a/src/color.c b/src/color.c
index 9797949c..b89dc903 100644
--- a/src/color.c
+++ b/src/color.c
@@ -108,8 +108,6 @@ void color_init(void)
     bool using_defaults = FALSE;
     short foreground, background;
 
-    assert(openfile != NULL);
-
     /* If the terminal is not capable of colors, forget it. */
     if (!has_colors())
 	return;
@@ -164,8 +162,6 @@ void color_update(void)
     syntaxtype *sint = NULL;
     colortype *ink;
 
-    assert(openfile != NULL);
-
     /* If the rcfiles were not read, or contained no syntaxes, get out. */
     if (syntaxes == NULL)
 	return;
diff --git a/src/cut.c b/src/cut.c
index f5eb321c..a00d705d 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -82,8 +82,6 @@ void cut_to_eol(void)
 {
     size_t data_len = strlen(openfile->current->data);
 
-    assert(openfile->current_x <= data_len);
-
     if (openfile->current_x < data_len)
 	/* If we're not at the end of the line, move all the text from
 	 * the current position up to it, not counting the newline at
@@ -129,8 +127,6 @@ void do_cut_text(bool copy_text, bool cut_till_eof)
 #endif
     size_t was_totsize = openfile->totsize;
 
-    assert(openfile->current != NULL && openfile->current->data != NULL);
-
     /* If a chain of cuts was broken, empty the cutbuffer. */
     if (!keep_cutbuffer) {
 	free_filestruct(cutbuffer);
@@ -262,8 +258,6 @@ void do_uncut_text(void)
 {
     ssize_t was_lineno = openfile->current->lineno;
 
-    assert(openfile->current != NULL && openfile->current->data != NULL);
-
     /* If the cutbuffer is empty, get out. */
     if (cutbuffer == NULL)
 	return;
-- 
GitLab