mirror of
https://github.com/Tha14/toxic.git
synced 2024-10-03 06:45:35 +02:00
62 lines
1.6 KiB
Diff
62 lines
1.6 KiB
Diff
|
--- chat.c 2013-08-02 17:41:08.866583333 -0700
|
||
|
+++ chat2.c 2013-08-02 17:38:13.672991322 -0700
|
||
|
@@ -49,8 +49,10 @@
|
||
|
|
||
|
int inthour = timeinfo->tm_hour;
|
||
|
int intmin = timeinfo->tm_min;
|
||
|
+ int intsec = timeinfo->tm_sec;
|
||
|
char min[2];
|
||
|
char hour[2];
|
||
|
+ char sec[2];
|
||
|
sprintf(hour,"%d",inthour);
|
||
|
if (intmin < 10) {
|
||
|
sprintf(min,"0%d",intmin);
|
||
|
@@ -58,10 +60,17 @@
|
||
|
sprintf(min,"%d",intmin);
|
||
|
}
|
||
|
|
||
|
+ if (intsec < 10) {
|
||
|
+ sprintf(sec,"0%d",intsec);
|
||
|
+ } else {
|
||
|
+ sprintf(sec,"%d",intsec);
|
||
|
+ }
|
||
|
+
|
||
|
|
||
|
wattron(ctx->history, COLOR_PAIR(2));
|
||
|
wprintw(ctx->history,"%s",hour);
|
||
|
- wprintw(ctx->history,":%s ",min);
|
||
|
+ wprintw(ctx->history,":%s",min);
|
||
|
+ wprintw(ctx->history,":%s",sec);
|
||
|
wattron(ctx->history, COLOR_PAIR(4));
|
||
|
wprintw(ctx->history, "%s: ", now);
|
||
|
wattron(ctx->history, COLOR_PAIR(4));
|
||
|
@@ -111,8 +120,10 @@
|
||
|
|
||
|
int inthour = timeinfo->tm_hour; //Pretty bad, but it gets the job done
|
||
|
int intmin = timeinfo->tm_min;
|
||
|
+ int intsec = timeinfo ->tm_sec;
|
||
|
char min[2];
|
||
|
char hour[2];
|
||
|
+ char sec[2];
|
||
|
sprintf(hour,"%d",inthour);
|
||
|
if (intmin < 10) {
|
||
|
sprintf(min,"0%d",intmin);
|
||
|
@@ -120,9 +131,16 @@
|
||
|
sprintf(min,"%d",intmin);
|
||
|
}
|
||
|
|
||
|
+ if (intsec < 10) {
|
||
|
+ sprintf(sec,"0%d",intsec);
|
||
|
+ } else {
|
||
|
+ sprintf(sec,"%d",intsec);
|
||
|
+ }
|
||
|
+
|
||
|
wattron(ctx->history, COLOR_PAIR(2));
|
||
|
wprintw(ctx->history,"%s",hour);
|
||
|
- wprintw(ctx->history,":%s ",min);
|
||
|
+ wprintw(ctx->history,":%s",min);
|
||
|
+ wprintw(ctx->history,":%s ",sec);
|
||
|
wattron(ctx->history, COLOR_PAIR(1));
|
||
|
wprintw(ctx->history, "you: ", ctx->line);
|
||
|
wattroff(ctx->history, COLOR_PAIR(1));
|