Skip to content
Snippets Groups Projects
Commit a0284de9 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Use NSPR wrappers for MAX() instead of max().

parent 2ccb08c8
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1057 failed
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "sbbs.h" #include "sbbs.h"
#include "cmdshell.h" #include "cmdshell.h"
#include <nspr.h>
extern "C" void client_on(SOCKET sock, client_t* client, BOOL update); extern "C" void client_on(SOCKET sock, client_t* client, BOOL update);
...@@ -242,7 +243,7 @@ bool sbbs_t::logon() ...@@ -242,7 +243,7 @@ bool sbbs_t::logon()
bprintf(text[TimeToChangePw],cfg.sys_pwdays); bprintf(text[TimeToChangePw],cfg.sys_pwdays);
c=0; c=0;
while(c < max(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */ while(c < PR_MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
str[c]=sbbs_random(43)+'0'; str[c]=sbbs_random(43)+'0';
if(IS_ALPHANUMERIC(str[c])) if(IS_ALPHANUMERIC(str[c]))
c++; c++;
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "sbbs.h" #include "sbbs.h"
#include "petdefs.h" #include "petdefs.h"
#include "cmdshell.h" #include "cmdshell.h"
#include <nspr.h>
/****************************************************************************/ /****************************************************************************/
/* This function is invoked when a user enters "NEW" at the NN: prompt */ /* This function is invoked when a user enters "NEW" at the NN: prompt */
...@@ -381,7 +382,7 @@ BOOL sbbs_t::newuser() ...@@ -381,7 +382,7 @@ BOOL sbbs_t::newuser()
} }
else { else {
c=0; c=0;
while(c < max(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */ while(c < PR_MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
useron.pass[c]=sbbs_random(43)+'0'; useron.pass[c]=sbbs_random(43)+'0';
if(IS_ALPHANUMERIC(useron.pass[c])) if(IS_ALPHANUMERIC(useron.pass[c]))
c++; c++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment