- /* Copy tokstr to tokid, truncating it to LONG_NAME_LEN characters.*/
- strncpy (tokid, ds_c_str (&tokstr), LONG_NAME_LEN);
- tokid[LONG_NAME_LEN] = 0;
-
- /* Convert to upper case */
- for ( i = 0 ; i < ds_length(&tokstr) ; ++i )
- tokstr.string[i] = toupper(tokstr.string[i]);
+ /* Copy tokstr to tokid, possibly truncating it.*/
+ str_copy_trunc (tokid, sizeof tokid, ds_c_str (&tokstr));