| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 76d7e1c commit ccc6359
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,12 +319,11 @@ utf_16_decode(PyObject *self, | |||
| 319 | 319 | if (!PyArg_ParseTuple(args, "t#|zi:utf_16_decode", | |
| 320 | 320 | &data, &size, &errors, &final)) | |
| 321 | 321 | return NULL; | |
| 322 | - /* XXX Why is consumed initialized to size? mvl */ | ||
| 323 | 322 | if (size < 0) { | |
| 324 | 323 | PyErr_SetString(PyExc_ValueError, "negative argument"); | |
| 325 | 324 | return 0; | |
| 326 | 325 | } | |
| 327 | - consumed = size; | ||
| 326 | + consumed = size; /* This is overwritten unless final is true. */ | ||
| 328 | 327 | decoded = PyUnicode_DecodeUTF16Stateful(data, size, errors, &byteorder, | |
| 329 | 328 | final ? NULL : &consumed); | |
| 330 | 329 | if (decoded == NULL) | |
@@ -348,12 +347,11 @@ utf_16_le_decode(PyObject *self, | |||
| 348 | 347 | &data, &size, &errors, &final)) | |
| 349 | 348 | return NULL; | |
| 350 | 349 | ||
| 351 | - /* XXX Why is consumed initialized to size? mvl */ | ||
| 352 | 350 | if (size < 0) { | |
| 353 | 351 | PyErr_SetString(PyExc_ValueError, "negative argument"); | |
| 354 | 352 | return 0; | |
| 355 | 353 | } | |
| 356 | - consumed = size; | ||
| 354 | + consumed = size; /* This is overwritten unless final is true. */ | ||
| 357 | 355 | decoded = PyUnicode_DecodeUTF16Stateful(data, size, errors, | |
| 358 | 356 | &byteorder, final ? NULL : &consumed); | |
| 359 | 357 | if (decoded == NULL) | |
@@ -377,12 +375,11 @@ utf_16_be_decode(PyObject *self, | |||
| 377 | 375 | if (!PyArg_ParseTuple(args, "t#|zi:utf_16_be_decode", | |
| 378 | 376 | &data, &size, &errors, &final)) | |
| 379 | 377 | return NULL; | |
| 380 | - /* XXX Why is consumed initialized to size? mvl */ | ||
| 381 | 378 | if (size < 0) { | |
| 382 | 379 | PyErr_SetString(PyExc_ValueError, "negative argument"); | |
| 383 | 380 | return 0; | |
| 384 | 381 | } | |
| 385 | - consumed = size; | ||
| 382 | + consumed = size; /* This is overwritten unless final is true. */ | ||
| 386 | 383 | decoded = PyUnicode_DecodeUTF16Stateful(data, size, errors, | |
| 387 | 384 | &byteorder, final ? NULL : &consumed); | |
| 388 | 385 | if (decoded == NULL) | |
@@ -413,12 +410,11 @@ utf_16_ex_decode(PyObject *self, | |||
| 413 | 410 | if (!PyArg_ParseTuple(args, "t#|zii:utf_16_ex_decode", | |
| 414 | 411 | &data, &size, &errors, &byteorder, &final)) | |
| 415 | 412 | return NULL; | |
| 416 | - /* XXX Why is consumed initialized to size? mvl */ | ||
| 417 | 413 | if (size < 0) { | |
| 418 | 414 | PyErr_SetString(PyExc_ValueError, "negative argument"); | |
| 419 | 415 | return 0; | |
| 420 | 416 | } | |
| 421 | - consumed = size; | ||
| 417 | + consumed = size; /* This is overwritten unless final is true. */ | ||
| 422 | 418 | unicode = PyUnicode_DecodeUTF16Stateful(data, size, errors, &byteorder, | |
| 423 | 419 | final ? NULL : &consumed); | |
| 424 | 420 | if (unicode == NULL) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments