summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBaptiste Jonglez <baptiste--git@jonglez.org>2012-05-13 14:09:22 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-14 19:32:18 +0200
commitb17475128de9c548fb2727256817345aa1f9273a (patch)
tree444bfec30efd8b668f5195145f9ed765dbdaf4d9 /src
parent13d6f8703bacfb8543c9d22c01db60e083650cad (diff)
downloadcalcurse-b17475128de9c548fb2727256817345aa1f9273a.zip
Various fixes.
Use snprintf(3) instead of sprintf(3) and fix a missing i18n tag. Signed-off-by: Baptiste Jonglez <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r--src/day.c2
-rw-r--r--src/utils.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/day.c b/src/day.c
index d74283f..43a5aec 100644
--- a/src/day.c
+++ b/src/day.c
@@ -742,7 +742,7 @@ update_rept (struct rpt **rpt, const long start)
const char *msg_wrong_time = _("Invalid time: start time must be before end time!");
const char *msg_wrong_date = _("The entered date is not valid.");
const char *msg_fmts =
- "Possible formats are [%s] or '0' for an endless repetetition";
+ _("Possible formats are [%s] or '0' for an endless repetetition");
const char *msg_enter = _("Press [Enter] to continue");
switch (status_ask_choice (msg_rpt_asktype, msg_rpt_choice, 4))
diff --git a/src/utils.c b/src/utils.c
index 5359538..1d27bce 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -208,7 +208,7 @@ status_ask_choice(const char *message, const char choice[], int nb_choice)
for (i = 1; i <= nb_choice; i++)
{
- sprintf (tmp, (i == nb_choice) ? "%c] " : "%c/", choice[i]);
+ snprintf (tmp, BUFSIZ, (i == nb_choice) ? "%c] " : "%c/", choice[i]);
strcat (avail_choice, tmp);
}
@@ -262,7 +262,7 @@ status_ask_simplechoice (const char *prefix, const char *choice[],
for (i = 0; i < nb_choice; i++)
{
- sprintf (tmp, ((i + 1) == nb_choice) ? "(%d) %s?" : "(%d) %s, ",
+ snprintf (tmp, BUFSIZ, ((i + 1) == nb_choice) ? "(%d) %s?" : "(%d) %s, ",
(i + 1), _(choice[i]));
strcat (choicestr, tmp);
}