Cooler_

sinister case

Jul 1st, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. /* something here is sinister, figure it out! */
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <stdint.h>
  6. #include <errno.h>
  7.  
  8. int
  9. main(int argc, char ** argv)
  10. {
  11.     char * input;
  12.     char * output;
  13.     int    i;
  14.  
  15.     if (argc < 2)
  16.     {
  17.         fprintf(stderr, "Usage: %s <string>\n", argv[0]);
  18.         exit(1);
  19.     }
  20.  
  21.     input  = malloc(strlen(argv[1]));
  22.     output = malloc(strlen(argv[1]));
  23.  
  24.     for (i = 0; i <= strlen(argv[1]); i++)
  25.     {
  26.         input[i] = argv[1][i];
  27.     }
  28.  
  29.     output = strdup(input);
  30.  
  31.     free(input);
  32.     free(output);
  33.  
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment