Yes, it's actually a C idiom. E.g., to process the contents of a file:
while (bytes_read = read(buffer)) { // Work with buffer } // ... Dropped out of read loop because zero bytes were read
Commonly used compilers can be set to warn when the above is used, requiring it to be changed to:
while ((bytes_read = read(buffer)) != 0) { // Work with buffer } // ... Dropped out of read loop because zero bytes were read
to avoid the warning. Of course, the assignment still takes place whether the target is bytes_read or current->uid.
Yeah, that can be a handy way to save typing another line of code, when it’s used intentionally. Unintentionally, it can cause you to pull your hair out trying to debug :)