From 9a04b4d3417b288466af240cddce78c6322eac72 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sat, 2 Nov 2002 03:37:09 +0000
Subject: [PATCH] Fixed bug in last commit: Numeric header fields were being
 tested with JSVAL_IS_STRING.

---
 src/sbbs3/js_msgbase.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/sbbs3/js_msgbase.c b/src/sbbs3/js_msgbase.c
index df6fe9311e..4159c71155 100644
--- a/src/sbbs3/js_msgbase.c
+++ b/src/sbbs3/js_msgbase.c
@@ -184,7 +184,7 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
 		smb_hfield(msg, SENDERORG, (ushort)strlen(cp), cp);
 	}
 
-	if(JS_GetProperty(cx, hdr, "from_net_type", &val) && JSVAL_IS_STRING(val)) {
+	if(JS_GetProperty(cx, hdr, "from_net_type", &val) && JSVAL_IS_INT(val)) {
 		nettype=(ushort)JSVAL_TO_INT(val);
 		smb_hfield(msg, SENDERNETTYPE, sizeof(nettype), &nettype);
 		if(p->smb.status.attr&SMB_EMAIL && nettype!=NET_NONE)
@@ -205,7 +205,7 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
 			msg->idx.to=atoi(cp);
 	}
 
-	if(JS_GetProperty(cx, hdr, "to_net_type", &val) && JSVAL_IS_STRING(val)) {
+	if(JS_GetProperty(cx, hdr, "to_net_type", &val) && JSVAL_IS_INT(val)) {
 		nettype=(ushort)JSVAL_TO_INT(val);
 		smb_hfield(msg, RECIPIENTNETTYPE, sizeof(nettype), &nettype);
 		if(p->smb.status.attr&SMB_EMAIL && nettype!=NET_NONE)
@@ -230,7 +230,7 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
 		smb_hfield(msg, REPLYTOEXT, (ushort)strlen(cp), cp);
 	}
 
-	if(JS_GetProperty(cx, hdr, "replyto_net_type", &val) && JSVAL_IS_STRING(val)) {
+	if(JS_GetProperty(cx, hdr, "replyto_net_type", &val) && JSVAL_IS_INT(val)) {
 		nettype=(ushort)JSVAL_TO_INT(val);
 		smb_hfield(msg, REPLYTONETTYPE, sizeof(nettype), &nettype);
 	}
@@ -311,19 +311,19 @@ static BOOL parse_header_object(JSContext* cx, private_t* p, JSObject* hdr, smbm
 	}
 	
 	/* Numeric Header Fields */
-	if(JS_GetProperty(cx, hdr, "attr", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "attr", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.attr=(ushort)JSVAL_TO_INT(val);
-	if(JS_GetProperty(cx, hdr, "auxattr", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "auxattr", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.auxattr=JSVAL_TO_INT(val);
-	if(JS_GetProperty(cx, hdr, "netattr", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "netattr", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.netattr=JSVAL_TO_INT(val);
-	if(JS_GetProperty(cx, hdr, "when_written_time", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "when_written_time", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.when_written.time=JSVAL_TO_INT(val);
-	if(JS_GetProperty(cx, hdr, "when_written_zone", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "when_written_zone", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.when_written.zone=(short)JSVAL_TO_INT(val);
-	if(JS_GetProperty(cx, hdr, "when_imported_time", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "when_imported_time", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.when_imported.time=JSVAL_TO_INT(val);
-	if(JS_GetProperty(cx, hdr, "when_imported_zone", &val) && JSVAL_IS_STRING(val)) 
+	if(JS_GetProperty(cx, hdr, "when_imported_zone", &val) && JSVAL_IS_INT(val)) 
 		msg->hdr.when_imported.zone=(short)JSVAL_TO_INT(val);
 
 	return(TRUE);
-- 
GitLab