看板 DFBSD_bugs 關於我們 聯絡資訊
:Thank you for the asprintf() advice Matt. I am not sure if I used it :right but it seems to work and it looks nicer. : :How's this one then? Better? I hope so :) A little better. The structure you should use is something like this: #include <assert.h> ... while ((cp = getremote(name)) != NULL) { deadfl = 0; if (stat(cp, &sb) < 0) { if (cp[0] != '/') { asprintf(&tmp_cp, "/dev/%s", cp); assert(tmp_cp != NULL); cp = tmp_cp; } } if ((uucplock = strrchr(cp, '/')) == NULL) uucplock = cp; else ++uucplock; ... } -Matt Matthew Dillon <dillon@backplane.com>