fix loop condition prev[sink] == 0 means there was a path found with the last step being a forward edge to the sink, and the edge being at index 0 in the array. This is a valid path (the same as any other path indicated by prev[sink] > 0).