View Issue Details

IDProjectCategoryView StatusLast Update
0003898unrealircdpublic2010-08-26 04:47
Reporterseraph Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version3.2.7 
Summary0003898: Temp GLine: One unneeded Space Character
DescriptionI´ve found an unneeded Space Character:
*** G:Line added for *@ggg.net on Fri Apr 2 19:01:23 2010 GMT (from x!~x@x to expire at Fri Apr 2 22:01:23 2010 GMT: xxx

It´s between at "expire at Fri Apr 2" between Apr and 2
Steps To Reproduceset a temp gline and see yourself
3rd party modules

Activities

seraph

2010-04-02 21:18

reporter   ~0016048

Addition: Same thing at "on Fri Apr 2"

driew

2010-04-03 11:30

reporter   ~0016049

I would argue that it is common practice for default timestamps to have the space after the month and day.

For instance, asctime looks like this in C:

Function: char * asctime (const struct tm *brokentime)

The asctime function writes the broken-down time value pointed at by brokentime into a string in a standard format:
"Tue May 21 13:46:22 1991\n"


  /* Get the current time. */
  curtime = time (NULL);

  /* Convert it to local time representation. */
  loctime = localtime (&curtime);

  /* Print out the date and time in the standard format. */
  fputs (asctime (loctime), stdout);

Prints: "Tue May 21 13:46:22 1991".

Which looks exactly like whats in the gline message.
This is so you can split the string by spaces, and read each value into code with ease.


I think it's even an RFC standard somewhere, but almost all programming languages has this standardized-ish time output.


Just my $.02, or .02c if you are verizon.

seraph

2010-04-03 12:18

reporter   ~0016053

i know but there are TWO spaces in there

driew

2010-04-03 12:29

reporter   ~0016054

Last edited: 2010-04-03 12:31

That's default behavior of asctime.

The message you see comes from:
timeret = asctime(gmtime((TS *)&setat_1)); - Gets the time in GMT, passes it through asctime
strncpyzt(gmt, timeret, sizeof(gmt)); - Copies it to gmt, (after a check to be sure TS is currently valid, due to time desyncs)
iCstrip(gmt); - Strips \n and \r, which is appended to the end of the string by asctime
snprintf(buf, 512, "%s added for %s@%s on %s GMT (from %s to expire at %s GMT: %s)",txt, parv[3], parv[4], gmt, parv[5], gmt2, reason); - Prepares buf with the message to send to opers

asctime does this, so that the following will line up (for logging purposes):
"Tue May 1 13:46:22 1991\n"
"Tue May 21 13:46:22 1991\n"

Edit: Since I can't use HTML, the bug tracker is ignoring a consecutive space (view source)
Or here is this version, with space replaced with _:
"Tue_May__1_13:46:22_1991\n"
"Tue_May_21_13:46:22_1991\n"

seraph

2010-04-03 12:38

reporter   ~0016055

ah ok, thanks for the explanation, ticket can get closed :)

driew

2010-04-03 12:41

reporter   ~0016056

Your welcome, I was a bit confused at first, since again, the bug tracker doesn't show consecutive spaces, so I was initially thinking: Apr2, that's a bit odd ;)

But yeah, let's see how many days it takes to get the ticket closed :)

ohnobinki

2010-08-26 04:47

reporter   ~0016316

12^2

Issue History

Date Modified Username Field Change
2010-04-02 21:15 seraph New Issue
2010-04-02 21:18 seraph Note Added: 0016048
2010-04-03 11:30 driew Note Added: 0016049
2010-04-03 12:18 seraph Note Added: 0016053
2010-04-03 12:29 driew Note Added: 0016054
2010-04-03 12:31 driew Note Edited: 0016054
2010-04-03 12:38 seraph Note Added: 0016055
2010-04-03 12:41 driew Note Added: 0016056
2010-08-26 04:47 ohnobinki QA => Not touched yet by developer
2010-08-26 04:47 ohnobinki U4: Need for upstream patch => No need for upstream InspIRCd patch
2010-08-26 04:47 ohnobinki Note Added: 0016316
2010-08-26 04:47 ohnobinki Status new => closed
2010-08-26 04:47 ohnobinki Resolution open => no change required