Minor cleanups.
Enabled !crash command if compiled with debug (not release).
This commit is contained in:
		
							parent
							
								
									5b5d9faf96
								
							
						
					
					
						commit
						0ef248759c
					
				| @ -19,6 +19,10 @@ | |||||||
| 
 | 
 | ||||||
| #include "uhub.h" | #include "uhub.h" | ||||||
| 
 | 
 | ||||||
|  | #ifdef DEBUG | ||||||
|  | #define CRASH_DEBUG | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| struct hub_command | struct hub_command | ||||||
| { | { | ||||||
| 	const char* message; | 	const char* message; | ||||||
| @ -99,7 +103,7 @@ static void send_message(struct hub_info* hub, struct user* user, const char* me | |||||||
| static int command_access_denied(struct hub_info* hub, struct user* user, struct hub_command* cmd) | static int command_access_denied(struct hub_info* hub, struct user* user, struct hub_command* cmd) | ||||||
| { | { | ||||||
| 	char temp[128]; | 	char temp[128]; | ||||||
| 	snprintf(temp, 128, "*** %s: Access denied!", cmd->prefix); | 	snprintf(temp, 128, "*** %s: Access denied.", cmd->prefix); | ||||||
| 	send_message(hub, user, temp); | 	send_message(hub, user, temp); | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| @ -314,6 +318,8 @@ int command_dipatcher(struct hub_info* hub, struct user* user, const char* messa | |||||||
| { | { | ||||||
| 	size_t n = 0; | 	size_t n = 0; | ||||||
| 	int rc; | 	int rc; | ||||||
|  | 
 | ||||||
|  | 	/* Parse and validate the command */ | ||||||
| 	struct hub_command* cmd = command_create(message); | 	struct hub_command* cmd = command_create(message); | ||||||
| 	if (!cmd) return 1; | 	if (!cmd) return 1; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user