We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4dbe22c commit 1a87696Copy full SHA for 1a87696
src/stdlib_string_type.fypp
@@ -421,7 +421,11 @@ contains
421
type(string_type), intent(in) :: string
422
integer :: ich
423
424
- ich = merge(ichar(string%raw(1:1)), 0, allocated(string%raw))
+ if (allocated(string%raw) .and. len_trim(string%raw) > 0) then
425
+ ich = ichar(string%raw(1:1))
426
+ else
427
+ ich = 0
428
+ end if
429
430
end function ichar_string
431
@@ -431,7 +435,11 @@ contains
435
432
436
433
437
434
- ich = merge(iachar(string%raw(1:1)), 0, allocated(string%raw))
438
439
+ ich = iachar(string%raw(1:1))
440
441
442
443
444
end function iachar_string
445
0 commit comments