Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc, char *argv[])
- {
- char *buffer = malloc(sizeof(char)*(strlen("man ")+strlen(argv[1])+1));
- if(argc<2 || strlen(argv[1])>50) {
- printf("Manpage <argument>\n");
- exit(0);
- }
- strcpy(buffer, "man ");
- strcat(buffer, argv[1]);
- system(buffer);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement