[PATCH] ddate: St. Tib's Day in other languages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In other languages than english, the translation of "St. Tib's Day" may not
be 13 bytes long. Example of what happens in german:
$ ddate 29 2 2008
St. Tib’s D, 3174 YOLD

Signed-off-by: Nick Erdmann <erdmann@xxxxxxxxxxx>
--- a/misc-utils/ddate.c	2011-07-20 21:55:23.000000000 +0200
+++ b/misc-utils/ddate.c	2011-08-17 18:11:12.437504258 +0200
@@ -223,6 +223,7 @@
     int tib_start=-1, tib_end=0;
     int i, fmtlen=strlen(fmt);
     char *bufptr=buf;
+    char *foo;
 
 /*    fprintf(stderr, "format(%p, \"%s\", dt)\n", buf, fmt);*/
 
@@ -249,7 +250,9 @@
     for(i=0; i<fmtlen; i++) {
 	if((i==tib_start) && (dt.day==-1)) {
 	    /* handle St. Tib's Day */
-	    strcpy(bufptr, _("St. Tib's Day")); bufptr += 13;
+	    foo = _("St. Tib's Day");
+	    while((*bufptr++=*foo++));
+	    --bufptr;
 	    i=tib_end;
 	} else {
 	    if(fmt[i]=='%') {
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux