чување 397160854f298ced4b00ca25f779ddb0cb313e21
родитељ 80ce3f31d664d32019457383769634dce3e98fe5
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Wed, 16 Jun 2021 18:24:39 +0200
Minor fixes
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 3, додавања: 24(+), брисања: 3(-)
diff --git a/INSTALL b/INSTALL
@@ -0,0 +1,21 @@
+Prerequisites
+=============
+
+* C compiler (GCC-compatible) - ${POE_CC:-gcc}
+* gzip
+
+Install
+-------
+
+ $ git clone https://git.sr.ht/~strahinja/poe
+ $ cd poe
+ $ su
+
+If you have djb redo:
+
+ # redo install
+
+if you don't:
+
+ # ./do install
+
diff --git a/draw.c b/draw.c
@@ -86,7 +86,7 @@ draw_string(const int x, const int y, const uint16_t fg, const uint16_t bg,
const int padding_left, const int padding_right,
const Alignment align)
{
- int col;
+ int col = 0;
uint32_t* us = calloc(strlen(s)+1, sizeof(uint32_t));
uint32_t* pus = NULL;
size_t us_len = 0;
@@ -180,7 +180,7 @@ draw_editbox(const struct DrawState* state)
struct PoEntry* entry = &state->entries[state->msgid_number-1];
if (entry->msgstr)
- strncpy(buf, entry->msgstr, MSGSTR_MAX);
+ strncpy(buf, entry->msgstr, MSGSTR_MAX-1);
else
buf[0] = 0;
diff --git a/poe.c b/poe.c
@@ -236,7 +236,7 @@ main(int argc, char** argv)
return version();
else
{
- strncpy(filename, argv[1], MAXPATH);
+ strncpy(filename, argv[1], MAXPATH-1);
filename[MAXPATH-1] = 0;
if (!filename[0])
print_error(EINVAL, "Invalid argument");