#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char buf[32];
int main(int argc, char* argv[], char* envp[]){
if(argc<2){
printf("pass argv[1] a number\n");
return 0;
}
int fd = atoi(argv[1]) - 0x1234;
printf("%d\n", fd);
int len = 0;
len = read(fd, buf, 32);
printf("%s", buf);
return 0;
}
This my code but I cant print buff. Because read function does not terminate. Please help what is wrong? I run a program from terminal like this:
./fd 4660