~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to src/interfaces/ecpg/pgtypeslib/timestamp.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-06-14 09:53:29 UTC
  • mto: (6.1.1 sid) (10.1.1 oneiric-proposed) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20110614095329-71gfhjywyp2c27au
Tags: upstream-9.1~beta2
ImportĀ upstreamĀ versionĀ 9.1~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
501
501
                                         * 4-digit year corresponding to the ISO week number.
502
502
                                         */
503
503
                                case 'G':
504
 
                                        tm->tm_mon -= 1;
505
 
                                        i = strftime(q, *pstr_len, "%G", tm);
506
 
                                        if (i == 0)
507
 
                                                return -1;
508
 
                                        while (*q)
509
504
                                        {
510
 
                                                q++;
511
 
                                                (*pstr_len)--;
 
505
                                                /* Keep compiler quiet - Don't use a literal format */
 
506
                                                const char *fmt = "%G";
 
507
 
 
508
                                                tm->tm_mon -= 1;
 
509
                                                i = strftime(q, *pstr_len, fmt, tm);
 
510
                                                if (i == 0)
 
511
                                                        return -1;
 
512
                                                while (*q)
 
513
                                                {
 
514
                                                        q++;
 
515
                                                        (*pstr_len)--;
 
516
                                                }
 
517
                                                tm->tm_mon += 1;
 
518
                                                replace_type = PGTYPES_TYPE_NOTHING;
512
519
                                        }
513
 
                                        tm->tm_mon += 1;
514
 
                                        replace_type = PGTYPES_TYPE_NOTHING;
515
520
                                        break;
516
521
 
517
522
                                        /*
682
687
                                         * decimal number.
683
688
                                         */
684
689
                                case 'V':
685
 
                                        i = strftime(q, *pstr_len, "%V", tm);
686
 
                                        if (i == 0)
687
 
                                                return -1;
688
 
                                        while (*q)
689
690
                                        {
690
 
                                                q++;
691
 
                                                (*pstr_len)--;
 
691
                                                /* Keep compiler quiet - Don't use a literal format */
 
692
                                                const char *fmt = "%V";
 
693
 
 
694
                                                i = strftime(q, *pstr_len, fmt, tm);
 
695
                                                if (i == 0)
 
696
                                                        return -1;
 
697
                                                while (*q)
 
698
                                                {
 
699
                                                        q++;
 
700
                                                        (*pstr_len)--;
 
701
                                                }
 
702
                                                replace_type = PGTYPES_TYPE_NOTHING;
692
703
                                        }
693
 
                                        replace_type = PGTYPES_TYPE_NOTHING;
694
704
                                        break;
695
705
 
696
706
                                        /*