~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-security

« back to all changes in this revision

Viewing changes to common/t-percent.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-08-04 12:27:49 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20090804122749-q0j52zp6xmzvyall
Tags: 2.0.12-0ubuntu1
* New upstream release.
* Add 01-scd-pw2.patch, 03-opgp-writekey.patch, and 06-opgp-sign3072.patch
  from https://bugs.g10code.com/gnupg/issue1094 to make OpenPGP 2.0
  smartcards work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
      "%0A+ABC%09"
67
67
    }, { NULL, NULL }
68
68
  };
69
 
  char *buf;
 
69
  char *buf, *buf2;
70
70
  int i;
 
71
  size_t len;
71
72
  
72
73
  for (i=0; tbl[i].string; i++)
73
74
    {
79
80
        }
80
81
      if (strcmp (buf, tbl[i].expect))
81
82
        fail (i);
 
83
      buf2 = percent_plus_unescape (buf, 0);
 
84
      if (!buf2)
 
85
        {
 
86
          fprintf (stderr, "out of core: %s\n", strerror (errno));
 
87
          exit (2);
 
88
        }
 
89
      if (strcmp (buf2, tbl[i].string))
 
90
        fail (i);
 
91
      xfree (buf2);
 
92
      /* Now test the inplace conversion.  */
 
93
      len = percent_plus_unescape_inplace (buf, 0);
 
94
      buf[len] = 0;
 
95
      if (strcmp (buf, tbl[i].string))
 
96
        fail (i);
82
97
      xfree (buf);
83
98
    }
84
99
}
85
100
 
86
101
 
 
102
 
87
103
int
88
104
main (int argc, char **argv)
89
105
{
90
106
  (void)argc;
91
107
  (void)argv;
92
108
  
 
109
  /* FIXME: We escape_unescape is not tested - only
 
110
     percent_plus_unescape.  */
93
111
  test_percent_plus_escape ();
94
112
 
95
113
  return 0;