Removed unneccesary variable, Okay sorry, I know I am not giving that much information, But this is really just compilation fixes which I am using git for so I can send them to my testing machine.

This commit is contained in:
MissValeska 2014-08-17 08:27:29 -07:00
parent 67a11b69a9
commit 6101dfe6df
2 changed files with 17 additions and 13 deletions

View File

@ -6,7 +6,7 @@ void usage();
void clean_up(); void clean_up();
int validity_check(char request[BUFFER_LENGTH]) { int validity_check(char request) {
if(strncmp(request,"help", (int)strlen(request)) == 0) if(strncmp(request,"help", (int)strlen(request)) == 0)
return 1; return 1;
@ -59,7 +59,7 @@ int validity_check(char request[BUFFER_LENGTH]) {
} }
void response_cleanup(char response[BUFFER_LENGTH]) { void response_cleanup(char response) {
char remove = 'a'; char remove = 'a';
@ -76,7 +76,7 @@ void response_cleanup(char response[BUFFER_LENGTH]) {
} }
/* Sends and receives to ntkd */ /* Sends and receives to ntkd */
void ntkd_request(char request[BUFFER_LENGTH]) { void ntkd_request(char request) {
int request_length; int request_length;
@ -161,7 +161,12 @@ void console_uptime(void) {
} }
void console(char request[BUFFER_LENGTH]) { int millisleep(unsigned ms)
{
return usleep(1000 * ms);
}
void console(char request) {
if(validity_check(request) == -2) if(validity_check(request) == -2)
printf("Error: Command has not been processed!\n"); printf("Error: Command has not been processed!\n");
@ -174,8 +179,10 @@ void console(char request[BUFFER_LENGTH]) {
exit(0); exit(0);
} }
if(validity_check(request) == 0) if(validity_check(request) == 0) {
ntkd_request(request); ntkd_request(request);
millisleep(200);
}
if(validity_check(request) == 1) if(validity_check(request) == 1)
usage(); usage();
@ -216,10 +223,6 @@ int main(void) {
request = (char)malloc(BUFFER_LENGTH); request = (char)malloc(BUFFER_LENGTH);
char *request1;
request1 = (char*)malloc(BUFFER_LENGTH);
do { do {
printf("\n>"); printf("\n>");
@ -228,10 +231,6 @@ int main(void) {
fflush(stdin); fflush(stdin);
request1[strlen(request)-1] = '\0';
strcpy(request, request1);
console(request); console(request);
} while(FALSE); } while(FALSE);

View File

@ -201,3 +201,8 @@ void ntkd_request(void) {
clean_up(); clean_up();
} }
void console_recv_send(void) {
opensocket();
ntkd_request();
}