Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 30917) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 30918) @@ -414,6 +414,7 @@ sprintf(cmd, "%s%s%s %s", libshell, sep, fullname, params); #endif /*fprintf(stderr, " cmd=%s\n", cmd);*/ + /* Make a copy of the output of the parametric so rewind() can be called on it */ fctx->field[F_TMPNAME].p = pcb_tempfile_name_new("pcb-rnd-pfp"); f = pcb_fopen(&PCB->hidlib, (char *)fctx->field[F_TMPNAME].p, "wb+"); if (f != NULL) { @@ -420,9 +421,13 @@ char buff[4096]; int len; fp = pcb_popen(&PCB->hidlib, cmd, "rb"); - while((len = fread(buff, 1, sizeof(buff), fp)) > 0) - fwrite(buff, 1, len, f); - pcb_pclose(fp); + if (fp != NULL) { + while((len = fread(buff, 1, sizeof(buff), fp)) > 0) + fwrite(buff, 1, len, f); + pcb_pclose(fp); + } + else + rnd_message(PCB_MSG_ERROR, "Parametric footprint: failed to execute %s\n", cmd); rewind(f); } free(cmd);