@@ -1162,7 +1162,7 @@ PPH_STRING EspConvertNewLinesToNulls(
1162
1162
SIZE_T count ;
1163
1163
SIZE_T i ;
1164
1164
1165
- text = PhCreateStringEx (NULL , String -> Length + 2 ); // plus one character for an extra null terminator (see below)
1165
+ text = PhCreateStringEx (NULL , String -> Length + sizeof ( UNICODE_NULL ) ); // plus one character for an extra null terminator (see below)
1166
1166
text -> Length = 0 ;
1167
1167
count = 0 ;
1168
1168
@@ -1176,7 +1176,7 @@ PPH_STRING EspConvertNewLinesToNulls(
1176
1176
1177
1177
if (String -> Buffer [i ] == '\n' )
1178
1178
{
1179
- text -> Buffer [count ++ ] = 0 ;
1179
+ text -> Buffer [count ++ ] = UNICODE_NULL ;
1180
1180
continue ;
1181
1181
}
1182
1182
@@ -1186,11 +1186,11 @@ PPH_STRING EspConvertNewLinesToNulls(
1186
1186
if (count != 0 )
1187
1187
{
1188
1188
// Make sure we have an extra null terminator at the end, as required of multistrings.
1189
- if (text -> Buffer [count - 1 ] != 0 )
1190
- text -> Buffer [count ++ ] = 0 ;
1189
+ if (text -> Buffer [count - 1 ] != UNICODE_NULL )
1190
+ text -> Buffer [count ++ ] = UNICODE_NULL ;
1191
1191
}
1192
1192
1193
- text -> Length = count * 2 ;
1193
+ text -> Length = count * sizeof ( WCHAR ) ;
1194
1194
1195
1195
return text ;
1196
1196
}
@@ -1204,9 +1204,9 @@ PPH_STRING EspConvertNullsToSpaces(
1204
1204
1205
1205
text = PhDuplicateString (String );
1206
1206
1207
- for (j = 0 ; j < text -> Length / 2 ; j ++ )
1207
+ for (j = 0 ; j < text -> Length / sizeof ( WCHAR ) ; j ++ )
1208
1208
{
1209
- if (text -> Buffer [j ] == 0 )
1209
+ if (text -> Buffer [j ] == UNICODE_NULL )
1210
1210
text -> Buffer [j ] = ' ' ;
1211
1211
}
1212
1212
0 commit comments