~493pocbrcycmdw7yksonho9o2qzz-o18bz-d18ecat4t1b76tkfi3vttrkfngli/libmemcached/feature-server_timeout

« back to all changes in this revision

Viewing changes to clients/generator.cc

  • Committer: Continuous Integration
  • Date: 2013-10-10 08:07:55 UTC
  • mfrom: (1166.1.3 libmemcached-1.0)
  • Revision ID: ci@tangent.org-20131010080755-t4keifqfkq6v71jf
Merge lp:~brianaker/libmemcached/1220229 Build: jenkins-Libmemcached-362

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "clients/generator.h"
24
24
 
 
25
#define KEY_BYTES 20
 
26
 
25
27
/* Use this for string generation */
26
28
static const char ALPHANUMERICS[]=
27
29
  "0123456789ABCDEFGHIJKLMNOPQRSTWXYZabcdefghijklmnopqrstuvwxyz";
75
77
 
76
78
  for (uint64_t x= 0; x < number_of; x++)
77
79
  {
78
 
    pairs[x].key= (char *)calloc(100, sizeof(char));
 
80
    pairs[x].key= (char *)calloc(KEY_BYTES, sizeof(char));
79
81
 
80
82
    if (pairs[x].key == NULL)
81
83
      goto error;
82
84
 
83
 
    get_random_string(pairs[x].key, 100);
84
 
    pairs[x].key_length= 100;
 
85
    get_random_string(pairs[x].key, KEY_BYTES);
 
86
    pairs[x].key_length= KEY_BYTES;
85
87
 
86
88
    if (value_length)
87
89
    {