~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_connect.cc

  • Committer: Toru Maesaka
  • Date: 2008-12-01 11:00:41 UTC
  • mto: (632.1.17 devel)
  • mto: This revision was merged to the branch mainline in revision 637.
  • Revision ID: dev@torum.net-20081201110041-gia57w4pw4qwh13t
Third pass of replacing MySQL's strmake() with libc calls

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
      tail: that's why first part of the scramble is placed here, and second
277
277
      part at the end of packet.
278
278
    */
279
 
    end= strmake(end, session->scramble, SCRAMBLE_LENGTH_323) + 1;
 
279
    end= strncpy(end, session->scramble, SCRAMBLE_LENGTH_323);
 
280
    end+= SCRAMBLE_LENGTH_323 + 1;
280
281
   
281
282
    int2store(end, server_capabilites);
282
283
    /* write server characteristics: up to 16 bytes allowed */
285
286
    memset(end+5, 0, 13);
286
287
    end+= 18;
287
288
    /* write scramble tail */
288
 
    end= strmake(end, session->scramble + SCRAMBLE_LENGTH_323, 
289
 
                 SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323) + 1;
 
289
    size_t scramble_len= SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323;
 
290
    end= strncpy(end, session->scramble + SCRAMBLE_LENGTH_323, scramble_len);
 
291
    end+= scramble_len + 1;
290
292
 
291
293
    /* At this point we write connection message and read reply */
292
294
    if (net_write_command(net, (unsigned char) protocol_version, (unsigned char*) "", 0,