* Print the indicated quantity of the given object. If quan == 0L then use * the current quantity. */
| 2872 | * the current quantity. |
| 2873 | */ |
| 2874 | void |
| 2875 | prinv(const char *prefix, struct obj *obj, long quan) |
| 2876 | { |
| 2877 | boolean total_of = (quan && (quan < obj->quan)); |
| 2878 | char totalbuf[QBUFSZ]; |
| 2879 | |
| 2880 | if (!prefix) |
| 2881 | prefix = ""; |
| 2882 | |
| 2883 | totalbuf[0] = '\0'; |
| 2884 | if (total_of) |
| 2885 | Snprintf(totalbuf, sizeof totalbuf, |
| 2886 | " (%ld in total).", obj->quan); |
| 2887 | pline("%s%s%s%s", prefix, *prefix ? " " : "", |
| 2888 | xprname(obj, (char *) 0, obj_to_let(obj), !total_of, 0L, quan), |
| 2889 | flags.verbose ? totalbuf : ""); |
| 2890 | } |
| 2891 | |
| 2892 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 2893 |
no test coverage detected