KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
char out_file_name[30]; ogSize = strlen(FileName); //i.e. - FileName_anylength.log (always.log) ogSize -= strlen(IN_FILE_SUFFIX); //amount of chars before .log strncpy( out_file_name, FileName, ogSize ); //out_file_name now is FileName_anylength (without the .log) Is this the best way to do this? Also, how do I guard that ogSize doesn't happen to be more than 30 chars as it is coming from user input? Thank You.
Tags (comma-separated)
Save Edits
Cancel