Skip to content
Snippets Groups Projects
Commit bc514df3 authored by Moe Jette's avatar Moe Jette
Browse files

Fix bug if getpwuid fails.

parent fea0b3b1
No related branches found
No related tags found
No related merge requests found
...@@ -257,7 +257,7 @@ _print_job_user_name( job_info_t* job, int width, bool right ) ...@@ -257,7 +257,7 @@ _print_job_user_name( job_info_t* job, int width, bool right )
return SLURM_SUCCESS; return SLURM_SUCCESS;
} }
user_info = getpwuid( (uid_t) job->user_id ); user_info = getpwuid( (uid_t) job->user_id );
if ( user_info != NULL || user_info->pw_name[0] == '\0' ) if ( user_info != NULL && user_info->pw_name[0] != '\0' )
_print_str( user_info->pw_name, width, right, true ); _print_str( user_info->pw_name, width, right, true );
else else
_print_int( job->user_id, width, right, true ); _print_int( job->user_id, width, right, true );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment