All wagging does not mean they are friendly. Tail wags by itself have different meanings. Even if the tail is high above their body you must look at the entirety of a dogs body - eyes, ear and stance.
Observe the dog for a complete picture. The dogs ears may be standing straight up or falling back. See if they are standing straight in a balanced way or leaning towards one side. The position of the mouth - open- panting- showing teeth- licking is also crucial. See if the eyes and forehead seem relaxed, soft or under stress.
Also pay attention to the dog s surrounding environment. For instance, if a female dog is feeding her pups, one must never approach her.