#include #include "zpm.h" /* for quoting against the shell replace ' with '\'' and surround with * single quotes */ int main(int ac, char **av) { size_t n = 0; size_t bufsize = 0; char *buffer = 0; int i; for (i=1;i bufsize) { buffer = realloc(buffer, n+1); if (buffer) { bufsize = n+1; } else { exit(EXIT_FAILURE); } } zpm_quote(av[i], buffer, bufsize); printf("%s\n", buffer); } return 0; }