char *p = *ptrp;
int size = *sizep;
int oc;
+ int err = 0;
if ( quote ) {
oc = shell_quote(p, size, str);
}
if ( oc >= size ) {
- p[size-1] = '\0';
- *ptrp += size-1;
- *sizep = 1;
- return 1; /* Overflow, string unusable */
+ err = 1;
+ oc = size-1;
}
*ptrp += oc;
+ **ptrp = '\0';
*sizep -= oc;
- return 0;
+ return err;
}
int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,