This edit shouldn't have been accepted.
This
cmd.Parameters.AddWithValue("@CustomerCode", txtkey2.Text);
cmd.Parameters.AddWithValue("@CustomerName",txtkey2.Text);
was replaced with:
cmd.Parameters.Add("@CustomerCode", SqlDbType.Int).Value =
(DropDownList2.SelectedItem.Text== "int" ? Convert.ToInt32(txtkey2.Text) :(object)DBNull.Value);
cmd.Parameters.Add("@CustomerName", SqlDbType.NVarChar, 50).Value =
(DropDownList2.SelectedItem.Text == "string" ? txtkey2.Text : (object)DBNull.Value);
and the comment to the edit was: improved formatting
. That is more than just improving the formatting.
I know that the edit can be undone by going back to an earlier revision, but it shouldn't have been accepted in the first place.
Also this edit shouldn't have been accepted as well:
this
if(!memcmp(p, p+far_half, near_half))
was replaced with
if (memcmp(p, p+far_half, near_half))
The !
was removed. The edit was made by an anonymous user.
Is there a proper way to flag invalid edits like that?
if (memcmp(...
change seems to be correct to me. The function wants returnfalse
if area one and two are not equal (they are not zeros). The algorithm still seems flawed, but the anonymous post seems to be correct. It is not invalid to change the meaning, if it corrects things.