summaryrefslogtreecommitdiff
path: root/testing/toxic
diff options
context:
space:
mode:
authorSean Qureshi <stqism@risingstormgames.com>2013-08-02 17:44:30 -0700
committerSean Qureshi <stqism@risingstormgames.com>2013-08-02 17:44:30 -0700
commit8bc8016291aa3f153390e505f614c7b52a6613ae (patch)
treebae586e06f403923b31deed3afe47bd49f8808d8 /testing/toxic
parent9267ab2fcaaaedb70c68de6daccea1660138312d (diff)
By popular demand, I made a patch to add seconds to the timestamp
Diffstat (limited to 'testing/toxic')
-rw-r--r--testing/toxic/seconds.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/testing/toxic/seconds.patch b/testing/toxic/seconds.patch
new file mode 100644
index 00000000..d7ce33a2
--- /dev/null
+++ b/testing/toxic/seconds.patch
@@ -0,0 +1,61 @@
1--- chat.c 2013-08-02 17:41:08.866583333 -0700
2+++ chat2.c 2013-08-02 17:38:13.672991322 -0700
3@@ -49,8 +49,10 @@
4
5 int inthour = timeinfo->tm_hour;
6 int intmin = timeinfo->tm_min;
7+ int intsec = timeinfo->tm_sec;
8 char min[2];
9 char hour[2];
10+ char sec[2];
11 sprintf(hour,"%d",inthour);
12 if (intmin < 10) {
13 sprintf(min,"0%d",intmin);
14@@ -58,10 +60,17 @@
15 sprintf(min,"%d",intmin);
16 }
17
18+ if (intsec < 10) {
19+ sprintf(sec,"0%d",intsec);
20+ } else {
21+ sprintf(sec,"%d",intsec);
22+ }
23+
24
25 wattron(ctx->history, COLOR_PAIR(2));
26 wprintw(ctx->history,"%s",hour);
27- wprintw(ctx->history,":%s ",min);
28+ wprintw(ctx->history,":%s",min);
29+ wprintw(ctx->history,":%s",sec);
30 wattron(ctx->history, COLOR_PAIR(4));
31 wprintw(ctx->history, "%s: ", now);
32 wattron(ctx->history, COLOR_PAIR(4));
33@@ -111,8 +120,10 @@
34
35 int inthour = timeinfo->tm_hour; //Pretty bad, but it gets the job done
36 int intmin = timeinfo->tm_min;
37+ int intsec = timeinfo ->tm_sec;
38 char min[2];
39 char hour[2];
40+ char sec[2];
41 sprintf(hour,"%d",inthour);
42 if (intmin < 10) {
43 sprintf(min,"0%d",intmin);
44@@ -120,9 +131,16 @@
45 sprintf(min,"%d",intmin);
46 }
47
48+ if (intsec < 10) {
49+ sprintf(sec,"0%d",intsec);
50+ } else {
51+ sprintf(sec,"%d",intsec);
52+ }
53+
54 wattron(ctx->history, COLOR_PAIR(2));
55 wprintw(ctx->history,"%s",hour);
56- wprintw(ctx->history,":%s ",min);
57+ wprintw(ctx->history,":%s",min);
58+ wprintw(ctx->history,":%s ",sec);
59 wattron(ctx->history, COLOR_PAIR(1));
60 wprintw(ctx->history, "you: ", ctx->line);
61 wattroff(ctx->history, COLOR_PAIR(1));