NachOS/code/test/getstring.c
2021-10-19 08:19:21 +02:00

18 lines
565 B
C

#include "syscall.h"
#define MAX_INPUT_SIZE 16
int main(){
char t[100];
// this test write write on the output what the user entered in the input
// If we remove the loop, all caracters after MAX_INPUT_SIZE will be writed
// on my linux shell... A quite big security flaw, imagine
// 1234567812345678sudo rm -rf /\n ;)
do {
//in our loop, char before the MAX_INPUT_SIZE sill be passed to the
// next getstring...
GetString(t, MAX_INPUT_SIZE);
PutString(t);
PutChar('\n');
}
while(1 == 1);
}