ni_routing: Check when the file could not be opened
PATCH v2 1/1 ni_routing: Check when the file could not be opened
Signed-off-by Ruffalo Lavoisier <[email protected]>
---
ah this is It's just a defense code just in case.
drivers/comedi/drivers/ni_routing/tools/convert_c_to_py.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/comedi/drivers/ni_routing/tools/convert_c_to_py.c +5 -0
@@ -140,6 +140,11 @@ int main(void) {FILE *fp =fopen ("ni_values.py" ,"w" ); +if (fp ==NULL ) { +fprintf (stderr,"Could not open file!" ); +return -1 ; + } +/* write route register values */ fprintf (fp,"ni_route_values = {\n" );for (int i =0 ; ni_all_route_values[i]; ++i)
Signature · 1 line
2.43.0