Provide a set of C# static methods mimicking standard C library's behavior to be able to straightforwardly make a first port of a C application to .NET core.
This initial port can then iteratively be converted into a more idiomatic .NET core application, keeping it functional all the way through.
Ideally you would also have a strong set of unit tests that would support the refactoring process.
As a starter, have some look at these simple examples
Excellent hints on parsing in C#: