Project

General

Profile

Bug #4170

buffer::ptr::cmp reports a == ab

Added by Loic Dachary over 6 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
common
Target version:
-
Start date:
02/16/2013
Due date:
% Done:

100%

Spent time:
Source:
Q/A
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:

Description

When running

  bufferptr a("A", 1);
  bufferptr ab("AB", 2);
  a.cmp(ab);

it returns zero because the first character is equal and cmp returns prematurely


Related issues

Related to Ceph - Tasks #4066: unit tests for src/include/buffer.h Resolved 02/09/2013 02/16/2013

Associated revisions

Revision d20bf07e (diff)
Added by Loic Dachary over 6 years ago

buffer::ptr::cmp only compares up to the smallest length

When running

bufferptr a("A", 1);
bufferptr ab("AB", 2);
a.cmp(ab);

it returned zero because. cmp only compared up to the length of the
smallest buffer and returned if they are identical. The function is
modified to compare the length of the buffers instead of returning.

http://tracker.ceph.com/issues/4170 refs #4170

Signed-off-by: Loic Dachary <>

History

#2 Updated by Loic Dachary over 6 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF