- message_subdir[0] = (i != 0)? ((uschar *)client_data)[5] : 0;
- snprintf(CS buffer, sizeof(buffer), "%s/msglog/%s/%s/%s",
- spool_directory, queue_name, message_subdir, (uschar *)client_data);
- if ((f = fopen(CS buffer, "r")))
+ message_subdir[0] = i != 0 ? ((uschar *)client_data)[5] : 0;
+ fname = spool_fname(US"msglog", message_subdir, US client_data, US"");
+ if ((f = fopen(CS fname, "r")))