Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. void shiftArgs(COMMAND *comm, int pos) {
  2.  
  3.  
  4. while (*comm.args[pos + 1] != NULL) {
  5. *comm.args[pos] = realloc(*comm.args[pos], sizeof(*comm.args[pos + 1]));
  6. strcpy(*comm.args[pos], *comm.args[pos + 1]);
  7. pos++;
  8. }
  9.  
  10. *comm.args[pos] = malloc(sizeof( NULL ));
  11. *comm.args[pos] = NULL;
  12.  
  13. free(*comm.args[pos + 1]);
  14.  
  15. return;
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement