Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include<string.h>
  2.  
  3. // The devil is in the details - nnp
  4.  
  5. void copy_buffers(char *argv[])
  6. {
  7.     char buf1[32], buf2[32], buf3[32];
  8.  
  9.     strncpy(buf2, argv[1], 31);
  10.     strncpy(buf3, argv[2], sizeof(buf3));
  11.     strcpy(buf1, buf3);
  12. }
  13.  
  14. int main(int argc, char *argv[])
  15. {
  16.     copy_buffers(argv);
  17.     return 0;
  18. }