From a86f09e10a212c06b195bf043cbb7c3d16edebaf Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 5 Sep 2006 19:38:57 +0000
Subject: [PATCH] lseek() does *not* return TRUE on failure... it returns -1 on
 failure. Fix bug. This effects all range requests (podcasts etc)

---
 src/sbbs3/websrvr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sbbs3/websrvr.c b/src/sbbs3/websrvr.c
index 652b22c662..05e7750401 100644
--- a/src/sbbs3/websrvr.c
+++ b/src/sbbs3/websrvr.c
@@ -1146,7 +1146,7 @@ static int sock_sendfile(http_session_t *session,char *path,unsigned long start,
 		lprintf(LOG_WARNING,"%04d !ERROR %d opening %s",session->socket,errno,path);
 	else {
 		if(start || end) {
-			if(lseek(file, start, SEEK_SET)) {
+			if(lseek(file, start, SEEK_SET)==-1) {
 				lprintf(LOG_WARNING,"%04d !ERROR %d seeking to position %lu in %s",session->socket,ERROR_VALUE,start,path);
 				return(0);
 			}
-- 
GitLab