aboutsummaryrefslogtreecommitdiffstats
path: root/kirc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kirc.c')
-rw-r--r--kirc.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/kirc.c b/kirc.c
index 20bd3ce..53b27fc 100644
--- a/kirc.c
+++ b/kirc.c
@@ -1062,25 +1062,23 @@ static void param_print_private(param p)
struct tm *timeinfo;
time ( &rawtime );
timeinfo = localtime ( &rawtime );
- char timestamp[13];
- if (!small_screen) {
- if (strnlen(p->nickname, p->nicklen) > (size_t)p->nicklen - 8) {
- *(p->nickname + p->nicklen - 8) = '\0';
- }
- strcpy(timestamp, "\x1b[90m");
- char buf[8];
- if (timeinfo->tm_hour < 10) {
- strcat(timestamp, "0");
- }
- snprintf(buf, sizeof(buf), "%d:", timeinfo->tm_hour);
- strcat(timestamp, buf);
- if (timeinfo->tm_min < 10) {
- strcat(timestamp, "0");
- }
- snprintf(buf, sizeof(buf), "%d\x1b[0m ", timeinfo->tm_min);
- strcat(timestamp, buf);
- printf("%s", timestamp);
- }
+ char timestamp[16];
+ if (strnlen(p->nickname, p->nicklen) > (size_t)p->nicklen - 8) {
+ *(p->nickname + p->nicklen - 8) = '\0';
+ }
+ strcpy(timestamp, "\x1b[90m");
+ char buf[16];
+ if (timeinfo->tm_hour < 10) {
+ strcat(timestamp, "0");
+ }
+ snprintf(buf, sizeof(buf), "%d:", timeinfo->tm_hour);
+ strcat(timestamp, buf);
+ if (timeinfo->tm_min < 10) {
+ strcat(timestamp, "0");
+ }
+ snprintf(buf, sizeof(buf), "%d\x1b[0m ", timeinfo->tm_min);
+ strcat(timestamp, buf);
+ printf("%s", timestamp);
int s = 0;
if (strnlen(p->nickname, MSG_MAX) <= (size_t)p->nicklen + strnlen(timestamp, sizeof(timestamp))) {
s = p->nicklen - strnlen(p->nickname, MSG_MAX) - strnlen(timestamp, sizeof(timestamp));
@@ -1146,11 +1144,9 @@ static void raw_parser(char *string)
};
if (WRAP_LEN > p.maxcols / 3) {
- small_screen = 1;
p.nicklen = p.maxcols / 3;
}
else {
- small_screen = 0;
p.nicklen = WRAP_LEN;
}
if (*chan != '\0' && !memcmp(p.command, "001", sizeof("001") - 1)) {