- /* Print filename or first option */
- if (opcode != OACK)
- ND_PRINT((ndo, "\""));
- i = fn_print(ndo, p, ndo->ndo_snapend);
- if (opcode != OACK)
- ND_PRINT((ndo, "\""));
-
- /* Print the mode (RRQ and WRQ only) and any options */
- while ((p = (const u_char *)strchr((const char *)p, '\0')) != NULL) {
- if (length <= (u_int)(p - (const u_char *)&tp->th_block))
- break;
- p++;
- if (*p != '\0') {
+ ui = fn_printztn(ndo, p, length, ndo->ndo_snapend);
+ if (ui == 0)
+ goto trunc;
+ p += ui;
+ length -= ui;
+
+ /* Print options, if any */
+ while (length != 0) {
+ ND_TCHECK(*p);
+ if (*p != '\0')