- /* TODO: improve the code */
- strncat(buffer, " ", sizeof(buffer)-strlen(buffer)-1);
- strncat(buffer, m_name(msgnum),
- sizeof(buffer)-strlen(buffer)-1);
+ /* TODO: Check for buffer length! */
+ strcat(buffer, " ");
+ strcat(buffer, m_name(msgnum));
+ }
+ strcat(buffer, "'");
+ /* TODO: This check is bad, but better than nothing */
+ if (strlen(buffer) > BUFSIZ) {
+ adios(NULL, "Too long attachment header line. Forward less messages.");
+ }
+ if (system(buffer) != 0) {
+ advise(NULL, "unable to add attachment header");