···55/*****************************************************************************
66 * File name: src/drivers/pri/pri.c *
77 * Created: 2012-01-31 by Hampa Hug <hampa@hampa.ch> *
88- * Copyright: (C) 2012-2019 Hampa Hug <hampa@hampa.ch> *
88+ * Copyright: (C) 2012-2025 Hampa Hug <hampa@hampa.ch> *
99 *****************************************************************************/
10101111/*****************************************************************************
···1515 * *
1616 * This program is distributed in the hope that it will be useful, but *
1717 * WITHOUT ANY WARRANTY, without even the implied warranty of *
1818- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1818+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1919 * Public License for more details. *
2020 *****************************************************************************/
2121···1322132213231323 return (0);
13241324}
13251325+13261326+/* Force a <nl> at the end of the comment */
13271327+int pri_img_add_comment_nl (pri_img_t *img)
13281328+{
13291329+ if (img->comment_size == 0) {
13301330+ return (0);
13311331+ }
13321332+13331333+ if (img->comment[img->comment_size - 1] == 0x0a) {
13341334+ return (0);
13351335+ }
13361336+13371337+ if (pri_img_add_comment (img, (unsigned char *) "\x0a", 1)) {
13381338+ return (1);
13391339+ }
13401340+13411341+ return (0);
13421342+}
+3-2
src/drivers/pri/pri.h
···55/*****************************************************************************
66 * File name: src/drivers/pri/pri.h *
77 * Created: 2012-01-31 by Hampa Hug <hampa@hampa.ch> *
88- * Copyright: (C) 2012-2019 Hampa Hug <hampa@hampa.ch> *
88+ * Copyright: (C) 2012-2025 Hampa Hug <hampa@hampa.ch> *
99 *****************************************************************************/
10101111/*****************************************************************************
···1515 * *
1616 * This program is distributed in the hope that it will be useful, but *
1717 * WITHOUT ANY WARRANTY, without even the implied warranty of *
1818- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1818+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1919 * Public License for more details. *
2020 *****************************************************************************/
2121···134134135135int pri_img_add_comment (pri_img_t *img, const unsigned char *buf, unsigned cnt);
136136int pri_img_set_comment (pri_img_t *img, const unsigned char *buf, unsigned cnt);
137137+int pri_img_add_comment_nl (pri_img_t *img);
137138138139139140#endif